Tagged: developer, gunter, Visual Editor
-
AuthorPosts
-
January 31, 2019 at 1:01 pm #1060946
There is any way to keep multiple new line spaces.
It is really frustrating to have to divide the paragraphs into many blocksJanuary 31, 2019 at 1:10 pm #1060952I don’t understand your question. What exactly would you like to get changed?
Is it the Element Preview field you don’t like to have?
Dashboard – Enfold (Child) – Layout Builder and check: “Disable advance layout builder preview in backend”Edit : now i see the movie – it took some time for the movie to start.
January 31, 2019 at 1:13 pm #1060955Ok Is it the Element Preview field, but I meant that the multiple new line is removed after saving the text block.
There is any way to keep multiple new line spaces?- This reply was modified 5 years, 10 months ago by differens.
January 31, 2019 at 3:16 pm #1061007bump
January 31, 2019 at 6:10 pm #1061090bump 2
January 31, 2019 at 7:01 pm #1061108I don’t think you’re doing yourself a favor with a bump. This gives your theme a new timestamp and is therefore more recent. The mods I think work it off chronologically.
Besides, it’s not an enfold problem. The wpautop function is WordPress own and the TinyMCE is a bit hard to be influenced there.
I have already tried tinymce.init, but have not yet had any success.
It’s up to you to use a<br class="noclear">
in the html editor field several times instead of<br>
.January 31, 2019 at 7:17 pm #1061115With the wordpress 5 editor this does not happen. This is an enfold problem!
I have already tried to disable all the plugins without success.I think also it’s unusual to have to use the HTML after buy a visual editor
Thanks for the supportJanuary 31, 2019 at 7:50 pm #1061129the thing is the multiple br use.
If you use in Visual Mode the shift and the return – you wil have one<br>
If you use the Return without shift it wil end in a p-tag.January 31, 2019 at 8:17 pm #1061139I have try shift+Return in Visual Mode but nothing changes.
Also if i add multple <p></p> or <br/> it is removed. :(I really appreciate your help
February 1, 2019 at 4:48 am #1061344these are the lines in formatting.php (WordPress File) to be responsible for multiple br replacement:
line 476ff// Change multiple <br>s into two line breaks, which will turn into paragraphs. $pee = preg_replace('|<br\s*/?>\s*<br\s*/?>|', "\n\n", $pee);
what makes me wonder is that the old filter in functions.php child-theme:
remove_filter( 'the_content', 'wpautop' ); remove_filter( 'the_excerpt', 'wpautop' );
seems not to work as it should.
Even the filter tiny_mce_before_init i try to influence it via that filter
add_filter( 'tiny_mce_before_init', 'change_mce_options' ); function change_mce_options( $init ) { $init['extended_valid_elements'] = '*[*]'; $init['remove_linebreaks'] = false; $init['convert_newlines_to_brs'] = true; $init['remove_redundant_brs'] = false; return $init; }
no effect
the edited textblock.php ALB Element with no wpautop stripslash : https://pastebin.com/M91L76av
_________________
A multiple <br> will always be tranformed to one p-tagFebruary 11, 2019 at 12:37 pm #1065402so I have searched the internet in vain for a solution that WordPress does not automatically remove the multiple line breaks.
Perhaps it is a combination of influences from both WordPress and Enfold settings that counteracts this. Here I think a developer has to take a look; my skills aren’t enough for that anymore.
February 12, 2019 at 10:45 am #1065887Hi,
This is a known problem. I already tried to find a solution – but Kriesi and I finally rejected it because it could cause more problems with existing sites and break them.
Removing the
<br>
happens already in js when clicking the save button and not in php – therefore the php filters won’t work.
Probably the soloution from @guenni007 with
<br class="noclear">
is a good workaround.
At the moment we do not have a stable working solution for that.
@Guenni007 Thanks for joining :)Best regards,
GünterFebruary 13, 2019 at 1:17 am #1066168what you can do is to install a little plugin ( believe me manually adding custom buttons to the tinymce is hard stuff ) :
https://wordpress.org/plugins/visual-editor-custom-buttons/
you will then have the opportunity to add custom buttons to visual and text editor buttons.
you then can create a new button (if you like with an own icon)
everytime you press that button you will see that a linebreak is added – and will not be replace through WPFebruary 13, 2019 at 10:44 am #1066376February 13, 2019 at 4:20 pm #1066513 -
AuthorPosts
- You must be logged in to reply to this topic.