How to Fix BR Problems in WordPress 2.0


The phenomenon that BR tags in WordPress 2.0 are automatically changed to P tags

 

I upgraded to WordPress 2.04, but there was a phenomenon that all the br tags in the post were removed.

So there is only one line between the lines. When inputting, the line spacing is visible, but in the visible mode, all line spacing of 2 or more lines is changed to 1 line.

In other words, all BR tags are gone and only one P tag remains.

Disable the built-in Wiswick editor in WordPress, ChenPress Even if you change to the editor, or if you forcefully insert the BR tag without using the editor at all, it will all disappear. Even if you change between lines with Enter in the text editor, only one line appears when visible.

Even turning off WordPress should correct invalidly nested XHTML automatically in Options-writing.

I looked at wordpress.org Problem with replacing br tag with P in WordPress 2.0 was being discussed, but the standard problem was not presented with an answer.

For me, who divides paragraphs into 2-3 lines, the problem of BR tags in WordPress 2.0 affected the format of the entire article.
On the left, BRs are changed to one P, and on the right, paragraphs with BRs appear to be normal. There seems to be a big difference in readability.

 

 

 

To make BR tags work in WordPress 2.0


It seems like you need to find a function that changes the BR tag to P in WordPress and disable it.

wpautop function in functions-formatting.php filters the body found that After looking at this function, I thought it was possible to disable this function at all, so I modified the source as shown below, and BR worked. FYI, functions-formatting.php is located in wordpress/wp-includes/ .

function wpautop($pee, $br = 1) {
return $pee;
}

If you use the built-in WysiWyg editor of WordPress 2.0, BR does not appear when you press enter. The editor also seems to change BR. This built-in editor does not function well as a WYSIWY editor, such as creating links instead of showing HTML tags, even though it is WYSIWYK when you input and save HTML tags.

Turn off the built-in editor in WordPress 2.0 (you can turn it off by going to Options-writing), and use it from version 1.5 ChenPress , BR works as before.

 I wrote the article on writely.com, then copied it and ChenPress  It is pasted into the WYSIWYG editor, and it can be used as it was in WordPress 1.5. People who do not use the WYSIWYG editor and use enter when using a text editor would like to modify this function.

I don't know what the relationship between XHTML and BR is, but I think I did too much to get rid of all the space between lines by hitting enter on purpose.

 







Recommendations





0 If you like the article, please click the heart~ It will be a strength to bloggers (SNS/login/advertising is not related)



Articles you might like







Push-Up Star: Push-Up Counter

Automatic push-up measurement and voice count, various types of push-up measurement and push-up speed analysis, police officers, military fitness test, military academy, student health fitness assessment (POPs), etc. automatically calculated












Add a Comment

Email addresses are not disclosed. Required items *is indicated by

























This posting is part of Coupang Partners' activities, and a certain amount of commission is provided accordingly.



If you click the Add Channel button, you can view it in the KakaoTalk view.