• Hi,

    I know this is a topic which was asked already but I did not find a solution which actually works.

    Here’s a recap what does not work correctly: I added handcrafted HTML to the editor in “Text mode” — displays perfectly in any browser BUT if I switch between “Visual mode” and Text mode back and forth THEN my HTML is messed up.
    I GUESS THAT’s because WP in conjunction with TinyMCE doesn’t leave HTML alone, right?
    Is there a way that I can turn off that behavior?
    I tried following:
    function myformatTinyMCE($in)
    {
    $in[‘remove_linebreaks’]=false;
    $in[‘gecko_spellcheck’]=false;
    $in[‘keep_styles’]=true;
    $in[‘accessibility_focus’]=true;
    $in[‘tabfocus_elements’]=’major-publishing-actions’;
    $in[‘media_strict’]=false;
    $in[‘paste_remove_styles’]=false;
    $in[‘paste_remove_spans’]=false;
    $in[‘paste_strip_class_attributes’]=’none’;
    $in[‘paste_text_use_dialog’]=true;
    $in[‘wpeditimage_disable_captions’]=true;
    $in[‘plugins’]=’inlinepopups,tabfocus,paste,media,fullscreen,wordpress,wpeditimage,wpgallery,wplink,wpdialogs,wpfullscreen’;
    $in[‘content_css’]=get_template_directory_uri() . “/editor-style.css”;
    $in[‘wpautop’]=true;
    $in[‘apply_source_formatting’]=false;
    $in[‘theme_advanced_buttons1′]=’formatselect,forecolor,|,bold,italic,underline,|,bullist,numlist,blockquote,|,justifyleft,justifycenter,justifyright,justifyfull,|,link,unlink,|,wp_fullscreen,wp_adv’;
    $in[‘theme_advanced_buttons2′]=’pastetext,pasteword,removeformat,|,charmap,|,outdent,indent,|,undo,redo’;
    $in[‘theme_advanced_buttons3’]=”;
    $in[‘theme_advanced_buttons4’]=”;
    return $in;
    }
    add_filter(‘tiny_mce_before_init’, ‘myformatTinyMCE’ );

    in functions.php (within my theme folder) but it has no influence on the formatting.
    I don’t mind autop BUT I would also want to see the P tag in TEXT MODE. Also, any HTML tag which is used in TEXT mode should not be altered in any form when switching to VISUAL MODE.

    What is the final solution? How does it work?

    regards
    Frank

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘TinyMCE messes my code up after switching between Visual to Text edit’ is closed to new replies.