Skip to content
Permalink
Browse files

MDL-47002 atto: Prevent removal of Rangy spans

  • Loading branch information...
merrill-oakland committed Mar 25, 2015
1 parent 8885056 commit 7cf70d686e1697181ee4f4f915ad8c9f9cb8c037
@@ -869,8 +869,8 @@ EditorClean.prototype = {
{regex: /(<[^>]*?class\s*?=\s*?"[^>"]*?)(?:[\s]*Apple-[_a-zA-Z0-9\-]*)+/gi, replace: "$1"},
// Remove OLE_LINK# anchors that may litter the code.
{regex: /<a [^>]*?name\s*?=\s*?"OLE_LINK\d*?"[^>]*?>\s*?<\/a>/gi, replace: ""},
// Remove empty spans.
{regex: /<span[^>]*>(&nbsp;|\s)*<\/span>/gi, replace: ""}
// Remove empty spans, but not ones from Rangy.
{regex: /<span(?![^>]*?rangySelectionBoundary[^>]*?)[^>]*>(&nbsp;|\s)*<\/span>/gi, replace: ""}
];

// Apply the rules.

0 comments on commit 7cf70d6

Please sign in to comment.
You can’t perform that action at this time.