Are you ready to switch to HTML parsing permanently?

83.3% 65
1.3% 1
15.4% 12

78 Date 2010-04-14 00:49

Forums / Cotonti / Development / Poll: A global switch to HTML parsing

Are you ready?

Kilandor
#24173 2010-04-17 21:20
Well that is a different issue that could be solved via a config honestly.

In part of the parsing used to output text, it is a parameter of the function, but it is hard coded. All text is sent though the function nl2br() This converts all Line breaks to the HTML tag "<br>".

So really that issue is not caused by BBcode itself.

You could edit your system/functions.php

function sed_parse($text, $parse_bbcodes = TRUE, $parse_smilies = TRUE, $parse_newlines = TRUE)
{
	global $cfg, $sys, $sed_smilies, $L, $usr;

To
function sed_parse($text, $parse_bbcodes = TRUE, $parse_smilies = TRUE, $parse_newlines = TRUE)
{
	global $cfg, $sys, $sed_smilies, $L, $usr;
	$parse_newlines = FALSE;

If you do this, text should act as expect if you just threw a bunch of text into a <div> it would be all cramped together.

I understand what you are referring to about. Visual logic tells a person to hit enter 2x so they see a paragraph, but in doing so causes 2 <br> to be generated.(clearly I do it myself). And I think any way to remove the multiple would prevent anyone from making actual multiple breaks as or if they wanted.

So what we also need to do is add an option to prevent this from being used for people who do not want it.

Actually upon further inspection although minor we should be using nl2br($text, true) so it does xhtml compatable "<br />" instead of "<br>"