MDL-47002 atto: Prevent removal of Rangy spans
This commit is contained in:
+2
-2
@@ -1329,8 +1329,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[^>]*>( |\s)*<\/span>/gi, replace: ""}
|
||||
// Remove empty spans, but not ones from Rangy.
|
||||
{regex: /<span(?![^>]*?rangySelectionBoundary[^>]*?)[^>]*>( |\s)*<\/span>/gi, replace: ""}
|
||||
];
|
||||
|
||||
// Apply the rules.
|
||||
|
||||
+3
-3
File diff suppressed because one or more lines are too long
+2
-2
@@ -1318,8 +1318,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[^>]*>( |\s)*<\/span>/gi, replace: ""}
|
||||
// Remove empty spans, but not ones from Rangy.
|
||||
{regex: /<span(?![^>]*?rangySelectionBoundary[^>]*?)[^>]*>( |\s)*<\/span>/gi, replace: ""}
|
||||
];
|
||||
|
||||
// Apply the rules.
|
||||
|
||||
+2
-2
@@ -304,8 +304,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[^>]*>( |\s)*<\/span>/gi, replace: ""}
|
||||
// Remove empty spans, but not ones from Rangy.
|
||||
{regex: /<span(?![^>]*?rangySelectionBoundary[^>]*?)[^>]*>( |\s)*<\/span>/gi, replace: ""}
|
||||
];
|
||||
|
||||
// Apply the rules.
|
||||
|
||||
Reference in New Issue
Block a user