Skip to content

Commit f54285b

Browse files
committed
Now update-profiles.js and update-models.js strip away EN+SPACE character as requested on #32
1 parent 663cf95 commit f54285b

File tree

6 files changed

+809
-803
lines changed

6 files changed

+809
-803
lines changed

bin/update-models.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ models.forEach((type) => {
7676
// Remove ] from subgroups
7777
result = result.replace(/ {2,}],\n/g, ' },\n');
7878

79+
// Remove occurrences of unicode character 'EN SPACE' (U+2002)
80+
result = result.replace(/\u{2002}/gu, ' ');
81+
7982
// Fixing regex eg. /Yahoo\! Mindset/u -> /Yahoo! Mindset/u and /jsRSS++\/([0-9.]*)/u -> /jsRSS\+\+\/([0-9.]*)/u
8083
// result = result.replace(/\\!/g, '!').replace(/(regexp:\s+?.*?)\+\+(.*?)/g, '$1\\+\\+$2');
8184

bin/update-profiles.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ function escapeString(str) {
4343
if (!str) {
4444
return null;
4545
}
46-
return `'${(str + '').replace(/[\\']/g, '\\$&').replace(/\u0000/g, '\\0')}'`;
46+
return `'${(str + '')
47+
.replace(/[\\']/g, '\\$&')
48+
.replace(/\u{0000}/gu, '\\0')
49+
.replace(/\u{2002}/gu, ' ')}'`;
4750
}
4851

4952
/**

0 commit comments

Comments
 (0)