mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 07:56:06 +02:00
Merge branch 'MDL-49565-master' of git://github.com/merrill-oakland/moodle
This commit is contained in:
commit
44a7e27b7b
@ -1117,11 +1117,6 @@ EditorClean.prototype = {
|
||||
// Reference: "http://stackoverflow.com/questions/1068280/javascript-regex-multiline-flag-doesnt-work"
|
||||
{regex: /<style[^>]*>[\s\S]*?<\/style>/gi, replace: ""},
|
||||
|
||||
// Source: "http://stackoverflow.com/questions/2875027/clean-microsoft-word-pasted-text-using-javascript"
|
||||
// Source: "http://stackoverflow.com/questions/1068280/javascript-regex-multiline-flag-doesnt-work"
|
||||
// Remove all HTML comments.
|
||||
{regex: /<!--[\s\S]*?-->/gi, replace: ""},
|
||||
|
||||
// Remove any open HTML comment opens that are not followed by a close. This can completely break page layout.
|
||||
{regex: /<!--(?![\s\S]*?-->)/gi, replace: ""},
|
||||
|
||||
@ -1292,6 +1287,11 @@ EditorClean.prototype = {
|
||||
|
||||
// Rules that get rid of the real-nasties and don't care about normalize code (correct quotes, white spaces, etc).
|
||||
var rules = [
|
||||
// Stuff that is specifically from MS Word and similar office packages.
|
||||
// Remove if comment blocks.
|
||||
{regex: /<!--\[if[\s\S]*?endif\]-->/gi, replace: ""},
|
||||
// Remove start and end fragment comment blocks.
|
||||
{regex: /<!--(Start|End)Fragment-->/gi, replace: ""},
|
||||
// Remove any xml blocks.
|
||||
{regex: /<xml[^>]*>[\s\S]*?<\/xml>/gi, replace: ""},
|
||||
// Remove any <?xml><\?xml> blocks.
|
||||
|
File diff suppressed because one or more lines are too long
@ -1107,11 +1107,6 @@ EditorClean.prototype = {
|
||||
// Reference: "http://stackoverflow.com/questions/1068280/javascript-regex-multiline-flag-doesnt-work"
|
||||
{regex: /<style[^>]*>[\s\S]*?<\/style>/gi, replace: ""},
|
||||
|
||||
// Source: "http://stackoverflow.com/questions/2875027/clean-microsoft-word-pasted-text-using-javascript"
|
||||
// Source: "http://stackoverflow.com/questions/1068280/javascript-regex-multiline-flag-doesnt-work"
|
||||
// Remove all HTML comments.
|
||||
{regex: /<!--[\s\S]*?-->/gi, replace: ""},
|
||||
|
||||
// Remove any open HTML comment opens that are not followed by a close. This can completely break page layout.
|
||||
{regex: /<!--(?![\s\S]*?-->)/gi, replace: ""},
|
||||
|
||||
@ -1281,6 +1276,11 @@ EditorClean.prototype = {
|
||||
|
||||
// Rules that get rid of the real-nasties and don't care about normalize code (correct quotes, white spaces, etc).
|
||||
var rules = [
|
||||
// Stuff that is specifically from MS Word and similar office packages.
|
||||
// Remove if comment blocks.
|
||||
{regex: /<!--\[if[\s\S]*?endif\]-->/gi, replace: ""},
|
||||
// Remove start and end fragment comment blocks.
|
||||
{regex: /<!--(Start|End)Fragment-->/gi, replace: ""},
|
||||
// Remove any xml blocks.
|
||||
{regex: /<xml[^>]*>[\s\S]*?<\/xml>/gi, replace: ""},
|
||||
// Remove any <?xml><\?xml> blocks.
|
||||
|
10
lib/editor/atto/yui/src/editor/js/clean.js
vendored
10
lib/editor/atto/yui/src/editor/js/clean.js
vendored
@ -92,11 +92,6 @@ EditorClean.prototype = {
|
||||
// Reference: "http://stackoverflow.com/questions/1068280/javascript-regex-multiline-flag-doesnt-work"
|
||||
{regex: /<style[^>]*>[\s\S]*?<\/style>/gi, replace: ""},
|
||||
|
||||
// Source: "http://stackoverflow.com/questions/2875027/clean-microsoft-word-pasted-text-using-javascript"
|
||||
// Source: "http://stackoverflow.com/questions/1068280/javascript-regex-multiline-flag-doesnt-work"
|
||||
// Remove all HTML comments.
|
||||
{regex: /<!--[\s\S]*?-->/gi, replace: ""},
|
||||
|
||||
// Remove any open HTML comment opens that are not followed by a close. This can completely break page layout.
|
||||
{regex: /<!--(?![\s\S]*?-->)/gi, replace: ""},
|
||||
|
||||
@ -267,6 +262,11 @@ EditorClean.prototype = {
|
||||
|
||||
// Rules that get rid of the real-nasties and don't care about normalize code (correct quotes, white spaces, etc).
|
||||
var rules = [
|
||||
// Stuff that is specifically from MS Word and similar office packages.
|
||||
// Remove if comment blocks.
|
||||
{regex: /<!--\[if[\s\S]*?endif\]-->/gi, replace: ""},
|
||||
// Remove start and end fragment comment blocks.
|
||||
{regex: /<!--(Start|End)Fragment-->/gi, replace: ""},
|
||||
// Remove any xml blocks.
|
||||
{regex: /<xml[^>]*>[\s\S]*?<\/xml>/gi, replace: ""},
|
||||
// Remove any <?xml><\?xml> blocks.
|
||||
|
Loading…
x
Reference in New Issue
Block a user