#23476 closed defect (bug) (duplicate)
disabling wpautop in TinyMCE settings leads to strange behavior in Text editor
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | TinyMCE | Keywords: | has-patch |
Focuses: | Cc: |
Description
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); } });
Attachments (1)
Change History (3)
Note: See
TracTickets for help on using
tickets.
copy Text editor contents even if wpautop is disabled