Text formatting not working with qTranslate plugin

I am creating a multilingual website using wordpress as CMS.

i am using qTranslate plugin for multi language support. As soon as i enable the plugin, all formatting of text is lost. i.e. all paragraphs in the editor are merged into a single paragraph.

Read More

I have enabled this option in settings: “WordPress should correct invalidly nested XHTML automatically” but there is no change.

Any suggestions please?

Related posts

Leave a Reply

3 comments

  1. Add this code at the end of wp-contentthemesyour-theme-namefunctions.php:

    //************************** PATCH START *****************************
    
    // Fix for qTranslate plugin (that does not retain formatting in pages)
    
    if('html' != wp_default_editor()) {
                    remove_filter('the_editor_content', 'wp_richedit_pre');
                    add_filter('the_editor_content', 'wp_htmledit_pre');
            }
    remove_filter( 'the_content', 'wpautop' );
    if ( ! function_exists('tmce_replace') ) {
            function tmce_replace() {
                    $tadv_options = get_option('tadv_options', array());
                    $tadv_plugins = get_option('tadv_plugins', array());    
    ?>
    <script type="text/javascript">
    if ( typeof(jQuery) != 'undefined' ) {
      jQuery('body').bind('afterPreWpautop', function(e, o){
        o.data = o.unfiltered
        .replace(/caption] +?</object>/g, function(a) {
          return a.replace(/[rn]+/g, ' ');
        });
      }).bind('afterWpautop', function(e, o){
        o.data = o.unfiltered;
      });
    }
    </script>
    <?php
            }
            add_action( 'after_wp_tiny_mce', 'tmce_replace' );
    }
    function teslina_tinymce_config( $init ) { 
        $init['remove_linebreaks'] = false;
        $init['apply_source_formatting'] = true;
        $init['preformatted'] = true;
        $init['remove_redundant_brs'] = false;    
        return $init;
    }
    add_filter('tiny_mce_before_init', 'teslina_tinymce_config');
    
    
    //************************** PATCH END *******************************
    
  2. write simple post in html mode to test like this :

    <p>lorem</p>
    <p>ipsum</p>
    

    There is filter in wordpress to format text (plugin, or functions.php) try to find them, else try another plugin like Polylang.