[wp-trac] [WordPress Trac] #23476: disabling wpautop in TinyMCE settings leads to strange behavior in Text editor
WordPress Trac
noreply at wordpress.org
Thu Feb 14 21:57:20 UTC 2013
#23476: disabling wpautop in TinyMCE settings leads to strange behavior in Text
editor
-----------------------------+--------------------------
Reporter: leedo | Type: defect (bug)
Status: new | Priority: normal
Milestone: Awaiting Review | Component: TinyMCE
Version: | Severity: normal
Keywords: |
-----------------------------+--------------------------
If I disable the `wpautop` behavior in TinyMCE with a
`tiny_mce_before_init` filter like so:
{{{
function ars_disable_tinymce_wpautop($in) {
$in['wpautop'] = false;
$in['remove_linebreaks'] = false;
$in['apply_source_formatting'] = true;
return $in;
}}}
The text view of the editor exhibits some odd behavior when saving.
Instead of submitting the current state of the text editor, the text
editor is updated with the contents of the HTML view, and then saved.
However, if I click over to the Visual editor before saving it will save
correctly. I believe this logic in the `wordpress` TinyMCE plugin may be
the cause:
{{{
ed.onSaveContent.add(function(ed, o) {
if ( ed.getParam('wpautop', true) && typeof(switchEditors) == 'object' )
{
if ( ed.isHidden() )
o.content = o.element.value;
else
o.content = switchEditors.pre_wpautop(o.content);
}
});
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/23476>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list