Merge branch 'wip-MDL-50795-master' of git://github.com/abgreeve/moodle

This commit is contained in:
Dan Poltawski 2016-03-26 09:31:54 +08:00
commit 6a3116dd3c
4 changed files with 9 additions and 3 deletions

View File

@ -1314,6 +1314,8 @@ EditorClean.prototype = {
{regex: /(<[^>]*?style\s*?=\s*?")([^>"]*)(")/gi, replace: function(match, group1, group2, group3) { {regex: /(<[^>]*?style\s*?=\s*?")([^>"]*)(")/gi, replace: function(match, group1, group2, group3) {
// Remove MSO-blah, MSO:blah style attributes. // Remove MSO-blah, MSO:blah style attributes.
group2 = group2.replace(/(?:^|;)[\s]*MSO[-:](?:&[\w]*;|[^;"])*/gi,""); group2 = group2.replace(/(?:^|;)[\s]*MSO[-:](?:&[\w]*;|[^;"])*/gi,"");
// Remove backgroud color style.
group2 = group2.replace(/background-color:.*?;/gi,"");
return group1 + group2 + group3; return group1 + group2 + group3;
}}, }},
// Get all class attributes so we can work on them. // Get all class attributes so we can work on them.

File diff suppressed because one or more lines are too long

View File

@ -1303,6 +1303,8 @@ EditorClean.prototype = {
{regex: /(<[^>]*?style\s*?=\s*?")([^>"]*)(")/gi, replace: function(match, group1, group2, group3) { {regex: /(<[^>]*?style\s*?=\s*?")([^>"]*)(")/gi, replace: function(match, group1, group2, group3) {
// Remove MSO-blah, MSO:blah style attributes. // Remove MSO-blah, MSO:blah style attributes.
group2 = group2.replace(/(?:^|;)[\s]*MSO[-:](?:&[\w]*;|[^;"])*/gi,""); group2 = group2.replace(/(?:^|;)[\s]*MSO[-:](?:&[\w]*;|[^;"])*/gi,"");
// Remove backgroud color style.
group2 = group2.replace(/background-color:.*?;/gi,"");
return group1 + group2 + group3; return group1 + group2 + group3;
}}, }},
// Get all class attributes so we can work on them. // Get all class attributes so we can work on them.

View File

@ -290,6 +290,8 @@ EditorClean.prototype = {
{regex: /(<[^>]*?style\s*?=\s*?")([^>"]*)(")/gi, replace: function(match, group1, group2, group3) { {regex: /(<[^>]*?style\s*?=\s*?")([^>"]*)(")/gi, replace: function(match, group1, group2, group3) {
// Remove MSO-blah, MSO:blah style attributes. // Remove MSO-blah, MSO:blah style attributes.
group2 = group2.replace(/(?:^|;)[\s]*MSO[-:](?:&[\w]*;|[^;"])*/gi,""); group2 = group2.replace(/(?:^|;)[\s]*MSO[-:](?:&[\w]*;|[^;"])*/gi,"");
// Remove backgroud color style.
group2 = group2.replace(/background-color:.*?;/gi,"");
return group1 + group2 + group3; return group1 + group2 + group3;
}}, }},
// Get all class attributes so we can work on them. // Get all class attributes so we can work on them.