Has anyone else noticed problems with unclosed tags when using bbcode with flatforums? When they pop up they seem to pretty much kill formatting on pages.
Has anyone else noticed problems with unclosed tags when using bbcode with flatforums? When they pop up they seem to pretty much kill formatting on pages.
Comments
Comment #1
naudefj CreditAttribution: naudefj commentedCan you please provide a test case and maybe a screenshot to illustrate the problem?
Comment #2
rkn-dupe CreditAttribution: rkn-dupe commentedThanks for the reply, yes sorry i wasnt very detailed before.
To show what i am talking about please see:
http://libcom.org/forums/feedback-and-content/test-thread-unclosed-quote...
So when the bbcode is meant to close the tags - it looks almost like it is closing it - but in the wrong place? Perhaps this is something to do with float properties in flatforum?
Comment #3
naudefj CreditAttribution: naudefj commentedBBcode doesn't know where to add the closing tags, so it just appends them to the text:
preg_match_all('/\[quote/i', $body, $matches);$opentags = count($matches['0']);
preg_match_all('/\[\/quote\]/i', $body, $matches);
$unclosed = $opentags - count($matches['0']);
for ($i = 0; $i < $unclosed; $i++)
$body .= '[/quote]';
Comment #4
catch CreditAttribution: catch commentedThe worst thing seems to be "unopened" closing tags - so [/quote] or [/quote][/quote] - which don't seem to be automatically opened in the same way open tags are closed.
Comment #5
naudefj CreditAttribution: naudefj commentedBadly formatted text will always be problematic - you never know if the user would like to see the tags rendered or not.
I'm not sure if it's worth while persuing this further.
Comment #6
catch CreditAttribution: catch commentedCould there be an addition to this code to add open tags at the beginning of posts where there are extra closed tags?
preg_match_all('/\[quote/i', $body, $matches);$opentags = count($matches['0']);
preg_match_all('/\[\/quote\]/i', $body, $matches);
$unclosed = $opentags - count($matches['0']);
for ($i = 0; $i < $unclosed; $i++)
$body .= '[/quote]';
Comment #7
naudefj CreditAttribution: naudefj commentedPersonally, I don't think we should: It will create weird looking output and users will not necessarily know it's cased by invalid quoting. Also, if we do it for quotes, we will have to do it for all the other tags as well (too CPU intensive).