We are currently working on a php ubb transcoding task. The code highlighting plug-in is used.
If I use nl2br, each line will contain
, Pre also exists, resulting in
It is typed out.
If it is not added, multiple lines of text are displayed in one line. If you want to add [br] or leave two blank lines to indicate a br, the user experience will be greatly affected.
Therefore, I would like to ask you how to add a br to the place where the br is added. for example, if a common multi-line text is added, it will not be added to the places where the text is not added, such/
/
And so on
Reply to discussion (solution)You did not clarify your problem
The pre tag will treat the carriage return linefeed as the actual carriage return linefeed. that is to say, if there is a carriage return linefeed in the string, the actual result will be a real yellow line.