PHP: How to keep line-breaks using nl2br() with HTML Purifier?
问题 Issue: When using HTML Purifier to process user-inputted content, line-breaks are not being translated into <br /> tags. Consider the following user-inputted content: Lorem ipsum dolor sit amet. This is another line. <pre> .my-css-class { color: blue; } </pre> Lorem ipsum: <ul> <li>Lorem</li> <li>Ipsum</li> <li>Dolor</li> </ul> Dolor sit amet, MyName When processed using HTML Purifier, the above is being altered to the following: Lorem ipsum dolor sit amet. This is another line. .my-css-class