MDL-50795 atto: Pasting into atto removes background colour style.
Copying from one atto editor to another comes with a lot of style information. This removes the color attributes which make the page look ugly when competing with different themes.
This commit is contained in:
committed by
Dan Poltawski
parent
a30a81e3a0
commit
53d2f810ea
+2
@@ -1314,6 +1314,8 @@ EditorClean.prototype = {
|
||||
{regex: /(<[^>]*?style\s*?=\s*?")([^>"]*)(")/gi, replace: function(match, group1, group2, group3) {
|
||||
// Remove MSO-blah, MSO:blah style attributes.
|
||||
group2 = group2.replace(/(?:^|;)[\s]*MSO[-:](?:&[\w]*;|[^;"])*/gi,"");
|
||||
// Remove backgroud color style.
|
||||
group2 = group2.replace(/background-color:.*?;/gi,"");
|
||||
return group1 + group2 + group3;
|
||||
}},
|
||||
// Get all class attributes so we can work on them.
|
||||
|
||||
+3
-3
File diff suppressed because one or more lines are too long
+2
@@ -1303,6 +1303,8 @@ EditorClean.prototype = {
|
||||
{regex: /(<[^>]*?style\s*?=\s*?")([^>"]*)(")/gi, replace: function(match, group1, group2, group3) {
|
||||
// Remove MSO-blah, MSO:blah style attributes.
|
||||
group2 = group2.replace(/(?:^|;)[\s]*MSO[-:](?:&[\w]*;|[^;"])*/gi,"");
|
||||
// Remove backgroud color style.
|
||||
group2 = group2.replace(/background-color:.*?;/gi,"");
|
||||
return group1 + group2 + group3;
|
||||
}},
|
||||
// Get all class attributes so we can work on them.
|
||||
|
||||
+2
@@ -290,6 +290,8 @@ EditorClean.prototype = {
|
||||
{regex: /(<[^>]*?style\s*?=\s*?")([^>"]*)(")/gi, replace: function(match, group1, group2, group3) {
|
||||
// Remove MSO-blah, MSO:blah style attributes.
|
||||
group2 = group2.replace(/(?:^|;)[\s]*MSO[-:](?:&[\w]*;|[^;"])*/gi,"");
|
||||
// Remove backgroud color style.
|
||||
group2 = group2.replace(/background-color:.*?;/gi,"");
|
||||
return group1 + group2 + group3;
|
||||
}},
|
||||
// Get all class attributes so we can work on them.
|
||||
|
||||
Reference in New Issue
Block a user