Add to function.php
add_filter('tiny_mce_before_init', 'tiny_mce_before_init');
And function tiny_mce_before_init:
function tiny_mce_before_init($init) {
$init['setup'] = "function(ed) {
ed.onBeforeSetContent.add(function(ed, o) {
if ( o.content.indexOf('<pre') != -1) {
o.content = o.content.replace(/<pre[^>]*>[\\s\\S]+?<\\/pre>/g, function(a) {
return a.replace(/(\\r\\n|\\n)/g, '<br />');
});
}
});
}";
return $init;
}
http://core.trac.wordpress.org/ticket/19666 – it’s known bug, there is workaround but not fix tabs only new line chars
Related Posts:
- How to replace the content of tinyMCE editor in both text and visual mode using jQuery?
- How to keep non-breaking spaces in the visual editor?
- How to make WordPress and TinyMCE accept tags wrapping block-level elements as allowed in HTML5?
- Visual composer causing conflict with TinyMCE [closed]
- Adding a Media Button to the WordPress Content Editor
- Switch between Visual and HTML tab freely
- Add popup window to TinyMCE buttons
- TinyMCE editor is breaking my beautiful HTML
- WordPress Visual Editor Stripping HTML Changes
- Stop editor from removing tags and replacing them with nbsp
- wp_editor disable after reaching character count limit
- Is it possible to create nested lists in the WYSIWYG editor?
- TinyMCE Anchor Button not showing
- Is there a way to prevent the Editor from modifying my HTML
- How to disable TinyMCE 4 keyboard shortcuts
- How to customize the symbols that appear in the Visual Editor insert custom character
- Pasting code into pre-formatted text in Visual Editor not working in 3.3.1
- Add Shortcode inline inside Gutenberg block
- data-accordion removed in Visual Editor
- WordPress tinymce prints empty P tag and break html format
- Visual Editor freezing on text highlight since 4.3
- Remove empty lines ( ) when author updates their post
- tinyMCE duplicates previous block element when pressing return (visual editor)
- WordPress visual editor broke due to non standard port?
- Customising the WordPress TinyMce editor and it’s buttons
- Keep pasted pre formatted code as it is -with tabs- in visual editor
- Enable Visual Editor In Comments On CPT Edit Page
- Text cut off after the character 𪇆 in TinyMCE
- Adding image to visual editor popup for shortcode with wp.media and wp.mce: changing image duplicates shortcode
- Change Default Font Size and Remove Unwanted Font Sizes in TinyMCE
- How can I control the HTML output of my post?
- TinyMce in WordPress – Getting the “fullscreen” button to stay on the right when customising button layout
- Added custom styles to Visual Editor. Classes are appended and not replaced as intended
- unwanted and tags in text editor
- How to disable formatting
- Add table button in editor without Plugin
- Custom settings page TinyMce: no formatting when echoing value of editor
- Make Textarea a TinyMCE (editor box)
- How to get line breaks to translate to paragraphs?
- TinyMCE Visual Blocks plugin set Show blocks option for all users
- Gutenberg; Rich Text/HTML for Metadata Textarea Control in Back End
- Selectively remove empty line after line change
- Custom TinyMCE style formats disabled
- Prevent the Editor From Moving My
- Shift-Enter in tinyMCE (wp 3.3.1) not working
- Visual editor not showing all table rows
- Is it possible to disable the image alignment options in the post editor?
- Disable TinyMCE Table formatting width/height
- Open Insert/edit link popup
- Change syntax styling of TinyMCE HTML Text Editor
- More than one TinyMCE (wp_editor) with different $settings[‘drag_drop_upload’] values breaks
- Customer Support: TinyMCE stopped working (on some computers)
- customize tiny MCE blockqute
- Keyup events in tinymce editor not working
- How can I make the page editor trust me?
- How to force insertion in editor
- How can a TinyMCE modal return formatted/visual text?
- Stop editor from adding “amp;” after every “&”
- Why exactly does WordPress use p tags, not divs?
- Visual Editor is blank – 404 for plugin js
- How to show the contants in front end same as visual editor with space / linebreak?
- TinyMCE: Move buttons from 2nd row to top row
- enable TinyMCE for comment forms
- Best Browser for Editing Posts
- TinyMCE strips off the href tag inside span, if i change from text to visual
- clasic editor – article categories customization?
- tinymce and responsive line-breaks (short words after a period)
- How can I change TinyMCE’s default block format?
- Load WordPress Editor .css on Front End
- “Formats” Select Menu in WP Editor doesn’t show up with correct colour
- How to force wp excerpt to use br tag?
- Adding microdata using Structured Data Markup Helper HTML
- How to modify VisualComposer’s TinyMCE editor only for a specific shortcode
- WYSIWYG with HTML source?
- Preventing tinyMCE from auto formatting selected blocks of content
- wp_insert_post() dont post content like i need it :(
- WordPress Started Executing Code Inside PRE Tags Even They Are Properly Escaped
- How to add “Insert/Edit link” button in custom popup tinymce window?
- How to disable TinyMCE from removing span tags
- Forcing reload of editor-style.css
- Enqueue Script After TinyMCE initialized
- Is it possible to re-use the image details popup?
- Visual Tab Missing From Editor
- Snippet: Use classes instead of inline styles for text alignment
- Tiny MCE not adding p tag when saving theme option
- WordPress MultiSite Paste from Word Tool Does not work
- Remove quicktag buttons but not Visual / Text editor and tabs
- TinyMCE removes iframe attributes width and height
- Append Font Family in TinyMCE
- Add table controls with wp_editor minimal editor configuration (‘teeny’)
- How to reset ‘Advance’ tab on table property?
- editor text cut off when using 2 spaces (after periods)
- Advanced tinyMCE insert link error [closed]
- Removing tags around tags
- TinyMCE not loading in IE8
- Keyboard shortcut for headings on safari
- How do I prevent WordPress from eating my code?
- Changing code with ( ) when author updates their post (TinyMCE)
- Remove heading tags on line break
- WordPress WYSIWYG editor on demand, responsive