From d16db2d4f4b2fbd65722f40305fbc075edf72eb1 Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Wed, 23 Apr 2014 11:58:51 +1200 Subject: [PATCH] API tinymce editor no longer transforms paragraphs with margin-left into blockquotes This is legacy behaviour which does not often reflect the expected behaviour of the current editor. indent and outdent can (in some situations) prefer to use margin instead of padding. sapphiremce_cleanup faultily assumes that such indented text should be block quoted, and replaces this with a block quote element. This is not necessary, since the blockquote element can be placed explicitly by the user when necessary. To replicate the incorrect indentation behaviour, configure tinymce to use the 'lists' plugin (via admin/_config.php) and attempt to indent some text. Indented text will be unexpectedly replaced with blockquotes. --- docs/en/changelogs/3.2.0.md | 1 + javascript/HtmlEditorField.js | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/en/changelogs/3.2.0.md b/docs/en/changelogs/3.2.0.md index 685663538..789ae1cc0 100644 --- a/docs/en/changelogs/3.2.0.md +++ b/docs/en/changelogs/3.2.0.md @@ -5,6 +5,7 @@ * Minimum PHP version raised to 5.3.3 * DataObject::validate() method visibility changed to public * UploadField "Select from files" shows files in all folders by default + * HtmlEditorField no longer substitutes `
` for indented text ## Changelog diff --git a/javascript/HtmlEditorField.js b/javascript/HtmlEditorField.js index 73a00be4f..9ef036115 100644 --- a/javascript/HtmlEditorField.js +++ b/javascript/HtmlEditorField.js @@ -1400,8 +1400,6 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE; */ function sapphiremce_cleanup(type, value) { if(type == 'get_from_editor') { - // replace indented text with a
- value = value.replace(/

]*margin-left[^>]*>([^\n|\n\015|\015\n]*)<\/p>/ig,"

$1

"); // replace VML pixel image references with image tags - experimental value = value.replace(/<[a-z0-9]+:imagedata[^>]+src="?([^> "]+)"?[^>]*>/ig,"");