Rename fix-string.js and fixTextForSvg function name to a more readable name.

User regex to detect arabic characters.

Fix editing bugs.
This commit is contained in:
Milad Karbasizadeh
2017-01-02 14:48:22 +03:30
parent 92b5ce133d
commit af1ac89df7
3 changed files with 17 additions and 7 deletions
+9
View File
@@ -12,6 +12,7 @@ import { uiRawTagEditor } from './raw_tag_editor';
import { uiTagReference } from './tag_reference';
import { uiPreset } from './preset';
import { utilRebind } from '../util/rebind';
import { fixArabicScriptTextForSvg } from '../util/svg_paths_arabic_fix';
export function uiEntityEditor(context) {
@@ -224,6 +225,14 @@ export function uiEntityEditor(context) {
tags[k] = v;
}
});
var arabicRegex = /[\u0600-\u06FF]/g
if(tags.highway && tags.real_name){
if(arabicRegex.test(tags.real_name)){
tags.name = fixArabicScriptTextForSvg(tags.real_name);
} else{
tags.name = tags.real_name;
}
}
if (!onInput) {
tags = clean(tags);