Hi,
The bbcode filter works quite fine, but I have a little issue with lists, when you imbricate several lists.
For example if you do:
[list]
[*]first element
[list]
[*]subelement
[/list]
[*]second element
[/list]
The html result is:
<ol class="bb-list" style="list-style-type:circle;"><li>first element<br />
<ol class="bb-list" style="list-style-type:circle;"><li>subelement<br />
</li></ol><br />
<li>second element<br />
</li></ol>
Notice there's a missing (/li) tag.
The correct xhtml formatting would have been:
<ol class="bb-list" style="list-style-type:circle;"><li>first element<br />
<ol class="bb-list" style="list-style-type:circle;"><li>subelement<br /></li></ol>
</li>
<li>second element<br /></li></ol>
Thanks
Comments
Comment #1
Julien PHAM commentedbtw when we use [list] without any parameter, you should use (ul) tag instead of (ol) one, (ol) is for numbered lists.
Comment #2
naudefj commentedThe use of (ol) instead of (ul) is intentional. Without it we cannot have nested [list] tags (unless we rewrite the entire engine to be non-regex based).
As workaround, some BBCode variants introduced a separate [ulist] tag.
Comment #3
Julien PHAM commentedOk, this is not really a problem. But the first one about xhtml is a problem ;)
And a question: with ol you put a class with a list style type... so it is not possible to put several list indents with different style types ? Such as a round for the first level, a square for the second, ...
The circle type is setup directly into the bbcode filter? If we would like another style type I have to modify the bbcode one?
Comment #4
naudefj commented> Such as a round for the first level, a square for the second, ...
How about this:
I'll look into the xhtml problem later.
Comment #5
naudefj commentedFixed - see http://cvs.drupal.org/viewcvs/drupal/contributions/modules/bbcode/bbcode...
Comment #6
Julien PHAM commentedMmmm still does not work, or I missed something, and I use the latest cvs version...
When I do :
bbcode translates it as :
I think the problem is with the two first lines, because we open a (li) tag, then we open a (ol) tag without closing the first (li) tag, this (li) tag is only closed after the (ol) one.
The problem is recurrent with bbcode and lists, and is cause by the fact that (li) tags are only closed on the beginning of the next line and not the end of the line itself.
We have to close the (li) tag before opening a new (ol) tag.
Comment #7
naudefj commentedThis is what I get:
Nothing wrong with the above output!
Comment #8
Julien PHAM commentedSure there is something wrong, we should close the (li) with a (/li) "before" opening a new (ol) tag. Look at the first line, we do not close the (li) tag and we open a (ol) one.
And this kind of stuff returns xhtml error.
Try to validate the following page with xhtml (link at the bottom of the page) and you'll see what I mean:
http://min.lledrith.info/?q=node/103
Comment #9
naudefj commentedI've checked-in a patch that should solve the problem. Please download all files (not just the filter) and let me know how it goes.
Comment #10
Julien PHAM commentedIt seems it works, thanks
Comment #11
(not verified) commented