MDL-46746 atto: Remove unnecessary filtering of unicode characters

This commit is contained in:
Eric Merrill
2015-03-18 12:09:51 -04:00
parent 016c76ec57
commit d6ee0f6897
4 changed files with 6 additions and 48 deletions
@@ -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.
File diff suppressed because one or more lines are too long
@@ -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
View File
@@ -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.