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.
This commit is contained in:
Damian Mooyman 2014-04-23 11:58:51 +12:00
parent 1dcaf36c9b
commit d16db2d4f4
2 changed files with 1 additions and 2 deletions

View File

@ -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 `<blockquote />` for indented text
## Changelog

View File

@ -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 <blockquote>
value = value.replace(/<p [^>]*margin-left[^>]*>([^\n|\n\015|\015\n]*)<\/p>/ig,"<blockquote><p>$1</p></blockquote>");
// replace VML pixel image references with image tags - experimental
value = value.replace(/<[a-z0-9]+:imagedata[^>]+src="?([^> "]+)"?[^>]*>/ig,"<img src=\"$1\">");