MDL-50795 atto: Pasting into atto removes background colour style.
authorAdrian Greeve <adrian@moodle.com>
Fri, 18 Mar 2016 02:59:15 +0000 (10:59 +0800)
committerAdrian Greeve <adrian@moodle.com>
Thu, 24 Mar 2016 02:53:59 +0000 (10:53 +0800)
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.

lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-debug.js
lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor.js
lib/editor/atto/yui/src/editor/js/clean.js

index d5ed2a6..4efa43a 100644 (file)
Binary files a/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-debug.js and b/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-debug.js differ
index 6d77779..b64c044 100644 (file)
Binary files a/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js and b/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js differ
index d15b0a7..3b9fe61 100644 (file)
Binary files a/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor.js and b/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor.js differ
index 0c37c58..5b86018 100644 (file)
@@ -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.