How to break lines that contain both CJK and English characters in WordPress?

I found that the CJK article in my wordpress4.7 cannot correctly break lines containing both CJK characters and English.
Here is the article before publication.

enter image description here

All lines were correctly broken before publication.

enter image description here

Now it is displayed as below after publication. All lines are confused, broken in a bad format as an unexpected way.

enter image description here

I tried to fix it.

vim /var/www/html/wp/wp-content/themes/twentysixteen/style.css .site-inner { margin: 0 auto; max-width: 1320px; position: relative; } .site-content { word-wrap: break-word;overflow:hidden; word-break:break-all;white-space:pre-wrap; } 

To restart apache and wordpress, no effect will work.
My wordpress version is 4.7, the theme is twentysixteen.

+6
source share
3 answers

try adding this code to the functions.php theme file

  function my_tinymce_fix( $init ) { // html elements being stripped $init['extended_valid_elements'] = 'div[*], article[*]'; // don't remove line breaks $init['remove_linebreaks'] = false; // convert newline characters to BR $init['convert_newlines_to_brs'] = true; // don't remove redundant BR $init['remove_redundant_brs'] = false; // pass back to wordpress return $init; } add_filter('tiny_mce_before_init', 'my_tiny_mce_fix'); 
+2
source

Try the word word plugin. TinyMCE Advanced

It is possible to disable the automatic removal of the br tag and p tag from the plugin settings page.

+1
source

Set Do Not Drop My Markup

Do not use Mack My Markup - this is a plugin that will allow you

Disable all automatically generated HTML markup from your posts and pages per page .

It adds a small block in the WordPress editor; by default it disables automatic markup / formatting for this page / post

This means that all other pages can be the same and just turn off automatic formatting only for the page / publication that you are currently editing.

Then

when you have a page / message with mixed content, turn off the automatic formatting of this page / message and manually add the html mark, for example <h1> <br> <hr> <p> , etc.

0
source

Source: https://habr.com/ru/post/1013073/


All Articles