Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.2.4

Bug #512 [list] in a [list] breaks the first [list]
Submitted: 2004-01-03 12:40 UTC Modified: 2005-10-18 08:04 UTC
From: marduk at k-d-w dot org Assigned: quipo
Status: Closed Package: HTML_BBCodeParser
PHP Version: 4.3.4 OS: Windows XP
Roadmaps: (Not assigned)    
Subscription  


 [2004-01-03 12:40 UTC] marduk at k-d-w dot org
Description: ------------ If you try to write a [list] into another [list] the level one list is broken Reproduce code: --------------- [list] [*] Subject 1 [list] [*] First [*] Second [/list] [*] Subject 2 [/list] Expected result: ---------------- <ul> <li> Subject 1 </li> <ul> <li> First </li> <li> Second </li> </ul> <li> Subject 2 </li> </ul> Actual result: -------------- <ul> <li> Subject 1 </li> [list] <li> First </li> <li> Second </li> </ul> <li> Subject 2 </li>

Comments

 [2004-01-11 05:33 UTC] sjr at php dot net
Try using the [li] and [/li] tags instead of the [*] shorthand. Input code: ------------- [list] [li] Subject 1 [list] [li] First[/li] [li] Second[/li] [/list][/li] [li] Subject 2[/li] [/list] Actual output code: ------------- <ul> <li> Subject 1 <ol> <li> First</li> <li> Second</li> </ol></li> <li> Subject 2</li> </ul> Expected output code: ------------- <ul> <li> Subject 1 <ul> <li> First</li> <li> Second</li> </ul></li> <li> Subject 2</li> </ul> As you see, this still isn't completely ok. The [list] tag without a type parameter (like 1, a, A), should be replaced by an [ulist] tag by a regexp.
 [2004-01-11 05:39 UTC] sjr at php dot net
The problem with using the [*] shorthand is, that everything following it until there's a newline, is replaced by a regexp with [li]\\1[/li]. By design, the only tag allowed within <ul> and <ol> is <li>. So the second [list] tag isn't allowed, and won't be parsed.
 [2004-04-28 00:11 UTC] dufuz
Would be nice if you would try to fix this bug since PEPr depands on BBcodeParser ... :) Thanks!
 [2005-10-18 08:04 UTC] quipo
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.