Skip to content

Commit

Permalink
MDL-46746 atto: Remove unnecessary filtering of unicode characters
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmerrill committed Mar 18, 2015
1 parent 111141b commit 0a45b86
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 47 deletions.
Expand Up @@ -837,21 +837,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.
Expand Down

0 comments on commit 0a45b86

Please sign in to comment.