MDL-46746 atto: Remove unnecessary filtering of unicode characters
This commit is contained in:
+1
-15
@@ -1288,21 +1288,7 @@ EditorClean.prototype = {
|
||||
// Remove any <?xml><\?xml> blocks.
|
||||
{regex: /<\?xml[^>]*>[\s\S]*?<\\\?xml>/gi, replace: ""},
|
||||
// Remove <o:blah>, <\o:blah>.
|
||||
{regex: /<\/?\w+:[^>]*>/gi, replace: ""},
|
||||
|
||||
// Source: "http://www.tim-jarrett.com/labs_javascript_scrub_word.php"
|
||||
// Replace extended chars with simple text.
|
||||
{regex: new RegExp(String.fromCharCode(8220), 'gi'), replace: '"'},
|
||||
{regex: new RegExp(String.fromCharCode(8216), 'gi'), replace: "'"},
|
||||
{regex: new RegExp(String.fromCharCode(8217), 'gi'), replace: "'"},
|
||||
{regex: new RegExp(String.fromCharCode(8211), 'gi'), replace: '-'},
|
||||
{regex: new RegExp(String.fromCharCode(8212), 'gi'), replace: '--'},
|
||||
{regex: new RegExp(String.fromCharCode(189), 'gi'), replace: '1/2'},
|
||||
{regex: new RegExp(String.fromCharCode(188), 'gi'), replace: '1/4'},
|
||||
{regex: new RegExp(String.fromCharCode(190), 'gi'), replace: '3/4'},
|
||||
{regex: new RegExp(String.fromCharCode(169), 'gi'), replace: '(c)'},
|
||||
{regex: new RegExp(String.fromCharCode(174), 'gi'), replace: '(r)'},
|
||||
{regex: new RegExp(String.fromCharCode(8230), 'gi'), replace: '...'}
|
||||
{regex: /<\/?\w+:[^>]*>/gi, replace: ""}
|
||||
];
|
||||
|
||||
// Apply the first set of harsher rules.
|
||||
|
||||
+3
-3
File diff suppressed because one or more lines are too long
+1
-15
@@ -1277,21 +1277,7 @@ EditorClean.prototype = {
|
||||
// Remove any <?xml><\?xml> blocks.
|
||||
{regex: /<\?xml[^>]*>[\s\S]*?<\\\?xml>/gi, replace: ""},
|
||||
// Remove <o:blah>, <\o:blah>.
|
||||
{regex: /<\/?\w+:[^>]*>/gi, replace: ""},
|
||||
|
||||
// Source: "http://www.tim-jarrett.com/labs_javascript_scrub_word.php"
|
||||
// Replace extended chars with simple text.
|
||||
{regex: new RegExp(String.fromCharCode(8220), 'gi'), replace: '"'},
|
||||
{regex: new RegExp(String.fromCharCode(8216), 'gi'), replace: "'"},
|
||||
{regex: new RegExp(String.fromCharCode(8217), 'gi'), replace: "'"},
|
||||
{regex: new RegExp(String.fromCharCode(8211), 'gi'), replace: '-'},
|
||||
{regex: new RegExp(String.fromCharCode(8212), 'gi'), replace: '--'},
|
||||
{regex: new RegExp(String.fromCharCode(189), 'gi'), replace: '1/2'},
|
||||
{regex: new RegExp(String.fromCharCode(188), 'gi'), replace: '1/4'},
|
||||
{regex: new RegExp(String.fromCharCode(190), 'gi'), replace: '3/4'},
|
||||
{regex: new RegExp(String.fromCharCode(169), 'gi'), replace: '(c)'},
|
||||
{regex: new RegExp(String.fromCharCode(174), 'gi'), replace: '(r)'},
|
||||
{regex: new RegExp(String.fromCharCode(8230), 'gi'), replace: '...'}
|
||||
{regex: /<\/?\w+:[^>]*>/gi, replace: ""}
|
||||
];
|
||||
|
||||
// Apply the first set of harsher rules.
|
||||
|
||||
+1
-15
@@ -272,21 +272,7 @@ EditorClean.prototype = {
|
||||
// Remove any <?xml><\?xml> blocks.
|
||||
{regex: /<\?xml[^>]*>[\s\S]*?<\\\?xml>/gi, replace: ""},
|
||||
// Remove <o:blah>, <\o:blah>.
|
||||
{regex: /<\/?\w+:[^>]*>/gi, replace: ""},
|
||||
|
||||
// Source: "http://www.tim-jarrett.com/labs_javascript_scrub_word.php"
|
||||
// Replace extended chars with simple text.
|
||||
{regex: new RegExp(String.fromCharCode(8220), 'gi'), replace: '"'},
|
||||
{regex: new RegExp(String.fromCharCode(8216), 'gi'), replace: "'"},
|
||||
{regex: new RegExp(String.fromCharCode(8217), 'gi'), replace: "'"},
|
||||
{regex: new RegExp(String.fromCharCode(8211), 'gi'), replace: '-'},
|
||||
{regex: new RegExp(String.fromCharCode(8212), 'gi'), replace: '--'},
|
||||
{regex: new RegExp(String.fromCharCode(189), 'gi'), replace: '1/2'},
|
||||
{regex: new RegExp(String.fromCharCode(188), 'gi'), replace: '1/4'},
|
||||
{regex: new RegExp(String.fromCharCode(190), 'gi'), replace: '3/4'},
|
||||
{regex: new RegExp(String.fromCharCode(169), 'gi'), replace: '(c)'},
|
||||
{regex: new RegExp(String.fromCharCode(174), 'gi'), replace: '(r)'},
|
||||
{regex: new RegExp(String.fromCharCode(8230), 'gi'), replace: '...'}
|
||||
{regex: /<\/?\w+:[^>]*>/gi, replace: ""}
|
||||
];
|
||||
|
||||
// Apply the first set of harsher rules.
|
||||
|
||||
Reference in New Issue
Block a user