Closed (fixed)
Project:
Bbcode
Version:
master
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Reporter:
Created:
3 Mar 2006 at 12:36 UTC
Updated:
22 Mar 2006 at 08:01 UTC
Hi,
There's a problem in the way bbcode handles list.
For example: if I write:
[list]
[*]first element
[*]second element
Notice the line break between the two elements. This is because I want a line break.
Then for the second element, bbcode writes something like :
<p></li><li>second element
bbcode puts the (p) tag before the closing tag for the first element, and it returns an error...
Try to validate my page:
http://min.lledrith.info/?q=node/97
And you'll notice many xhtml errors, but I have not used special formatting, just image ones and this list one...
Thanks
Comments
Comment #1
naudefj commentedAre you using the latest CVS version? If not, please download the latest and re-test.
Comment #2
naudefj commentedComment #3
Julien PHAM commentedI just did...
I downloaded the latest CVS, and I tried to create a page with the following code:
[list]
[*]first element
[*]second element
[/list]
And the html result is:
Notice that the (p) tag is before the closing (/li) tag, which is not xhtml compliant. I think this is because bbcode closes (li) tags on a new line, just before the next (li) opening...
Comment #4
naudefj commentedRemove the open lines from your list. BBCode interprets it as you starting another paragraph.
Comment #5
Julien PHAM commentedYes but... no ;)
Because I want a line break between the two elements... so you say it is impossible to have a line break between the two elements without coding it myself with [br] tags? I can do this but I'm sure end users will put line breaks inside the list... and I cannot verify all articles for such things...
Perhaps an idea would be to code bbcode to always use (br) tags instead of (p) tags? I think it could be a good idea because a line break is not always a new paragraph. Example: for now, if I write
[i]one line
another line[/i]
It does not work because bbcode creates two paragraphs... it will work if bbcode just puts (br) instead...
Perhaps then a setting where the admin can choose whether to use (p) or (br) for new lines.
And, correct me if I'm wrong, but if we put TWO line breaks, it does not work in bbcode, bbcode creates just one paragraph...
So really I think bbcode, at least as an option, should put (br) instead of (p).
Comment #6
naudefj commentedThat is exactly what Drupal's "Line break converter" does. Just disable BBCode's "Smart paragraph and line breaks" and enable the "Line break converter".
Comment #7
Julien PHAM commentedNo, I tried your solution, I even created a new format without bbcode and just with drupal's line break converter, and it still puts (p) and not (br) when I put two line breaks...
And moreover with drupal's line break converter, it puts the whole list inside a new paragraph... so no xhtml anymore...
Comment #8
naudefj commentedThe latest version (CVS) now supports different line and paragraph break modes. Please download and test to see if it resolves your problem.
See http://drupal.org/cvs?commit=27222
Comment #9
Julien PHAM commentedIt seems it works fine, thanks... Now my articles pass xhtml validation...
Comment #10
(not verified) commented