filters – Line Breaks are stripped off when direction property is found


Using TinyMCE Advanced plugin on wordpress has the option to keep paragraph tags in the Classic block and the Classic Editor. And also by adding the wpautop hook

  remove_filter( 'the_content', 'wpautop' );
  remove_filter( 'the_excerpt', 'wpautop' );

This works perfectly by keeping the line breaks or p tags no matter how many line breaks there are.

However when using the direction buttons direction buttons for the text the line breaks are stripped off.

So for example if the p tag looks like

<p dir="ltr">Some text here</p>

Any line break after it gets stripped off especially if it’s a non-latin language.

Is there a way to resolve this issue for direction property?

P.S. I’m using WPML Plugin also if that might has a conflict issue

David Buik 2 years 2022-03-04T20:15:29-05:00 0 Answers 0 views 0

Leave an answer