• Resolved fabykennedy

    (@fabykennedy)


    Hi Stéphane. I’m sorry to post all these topics but I need to test well the plugin to see if it suits my needs.

    I noticed a very annoying issue. When translating, every time I switch between text and visual panels the <p> tag disappears. This is unacceptable to me because it messes up the entire work, meaning it deletes the text formatting and therefore the text in the article isn’t displayed properly.

    Please let me know if something can be done. Thank you.

Viewing 6 replies - 16 through 21 (of 21 total)
  • Plugin Author sbouey

    (@sbouey)

    I have found the problem (99% sure)

    when you change in the file

    wp-content/plugins/falang/admin/class-falang-admin.php

    line 2664

    $init[‘wpautop’] = false;//wpautop = yes

    it’s work when you switch the editor i have installed Advanced Editor Tools
    and they use this

    
    if ( $this->check_admin_setting( 'no_autop' ) ) {
       $init['wpautop'] = false;
       $init['indent'] = true;
       $init['tadv_noautop'] = true;
    }
    

    Keep paragraph tags in the Classic block and the Classic Editor
    Stop removing <p> and <br> tags in the Classic Editor and show them in the Text tab. This will make it possible to use more advanced coding in the Text tab without the back-end filtering affecting it much. However it may behave unexpectedly in rare cases, so test it thoroughly before enabling it permanently. Line breaks in the Text tab in the Classic Editor would still affect the output, in particular do not use empty lines, line breaks inside HTML tags or multiple <br> tags.

    i can probably put the same parameter in Falang

    Stéphane

    Thread Starter fabykennedy

    (@fabykennedy)

    Hi Stéphane. Honestly I already tried to use that plugin and even checking that option it didn’t work. It seemed right to inform you.

    Hi,

    I did some testing too. As a temp workaround, you can enclose the p tags of the paragraph in block editor comments. This work when you have both editors enabled (classic and block in settings > writing). They will then remain in the both editors (because WP fires a javascript version of autop which has that). In the Falang editor they will also copy these encapsulating comments, but (since that is MCE and does not use that javascript but MCE settings) there the p tags will replaced with an empty line, so you can still recognise the paragraph in text view, but the comments from the block editor remain.

    So if you enter in text mode classic:

    <!-- wp:paragraph -->
    <p>
    Your paragraph goes here.
    </p>
    <!-- /wp:paragraph -->

    Then the p tags remain visible in text view after saving and after switching to visual and back and saving. It seems the new autop has been set up to respect those comments in the Classic Editor too.

    In Falang MCE translation this shows as (after save):

    <!-- wp:paragraph -->
    
    Your paragraph goes here.
    
    <!-- /wp:paragraph -->

    so without the p tags showing, but with a blank line in place of the p tags. This then translates fine in the frontend, as before. When no tag is specified for a block of text, that block will automatically get wrapped inside a p tag in the frontend (by autop).

    Maybe that helps for now?

    Plugin Author sbouey

    (@sbouey)

    @fabykennedy

    i was probably not clear enought in my previous mail, i try this plugin just to look how it’s work but for what you want just change the line in

    wp-content/plugins/falang/admin/class-falang-admin.php
    
    line 2664
    
    $init[‘wpautop’] = false;

    you don’t need this extra plugin.

    But Row explain it , it’s just a display problem without <p> , the <p> are in the field.

    Stéphane

    Stéphane

    Thread Starter fabykennedy

    (@fabykennedy)

    You’ve saved me. Changing that voice makes the problem disappear and everything seems to work fine now. Thank you so much!

    Plugin Author sbouey

    (@sbouey)

    Perfect , problem for you solved.

    I will probably add a parameter for this in the next Falang version.

    Stéphane

Viewing 6 replies - 16 through 21 (of 21 total)
  • The topic ‘tag disappears when switching between text and visual panels’ is closed to new replies.