[PHPBB-14706] Nested list bbcode renders wrong

Discuss requests for comments/changes posted in the Issue Tracker for the development of phpBB. Current releases are 3.2/Rhea and 3.3/Proteus.
Post Reply
User avatar
canonknipser
Registered User
Posts: 71
Joined: Mon Sep 19, 2011 4:42 am
Location: Germany

[PHPBB-14706] Nested list bbcode renders wrong

Post by canonknipser »

https://tracker.phpbb.com/browse/PHPBB3-14706
Just a simple test case:

Code: Select all

[list][list=a][*]a[*]b[*]c[*]d[*]e[/list][*]outer list[/list]
shows:
    1. a
    2. b
    3. c
    4. d
    5. e
  • outer list

Screenshot from a 3.1.9-Board:
listerror.jpg
listerror.jpg (3.23 KiB) Viewed 13804 times
Greetings
Frank
phpbb.de support team member - no support via PM or mail
English is not my native language
Extensions and scripts for phpBB

User avatar
Jacob
Registered User
Posts: 102
Joined: Wed Jan 04, 2012 1:41 pm

Re: [PHPBB-14706] Nested list bbcode renders wrong

Post by Jacob »

I don't know about different behaviour, but your list is missing an asterisk before the second list. At least that's how I think it should be the proper format.

[list][*][list=a][*]a[*]b[*]c[*]d[*]e[/list][*]outer list[/list]
    1. a
    2. b
    3. c
    4. d
    5. e
  • outer list

User avatar
canonknipser
Registered User
Posts: 71
Joined: Mon Sep 19, 2011 4:42 am
Location: Germany

Re: [PHPBB-14706] Nested list bbcode renders wrong

Post by canonknipser »

yes, that way it works, but it is different from the 3.1-behaviour (and also the 3.0-behaviour); i posted a screenshot in my previous post, so you can compare the results from 3.1 and 3.2 using the same input ;)

In 3.0 and 3.1, you can post list-bb-codes [list] without a list-item-bb-code[*] followed immediate by another [list].
In 3.2, at least one list-item-bb-code[*] is needed after each[list] before posting another [list]
Greetings
Frank
phpbb.de support team member - no support via PM or mail
English is not my native language
Extensions and scripts for phpBB

User avatar
JoshyPHP
Registered User
Posts: 381
Joined: Fri Jul 08, 2011 9:43 pm

Re: [PHPBB-14706] Nested list bbcode renders wrong

Post by JoshyPHP »

phpBB 3.1 and 3.2 use a completely different algorithm to handle markup, that's why you see a difference between the two. Well-formed markup that was supported in 3.1 is rendered almost identically in 3.2 but you'll definitely see some differences in the way malformed markup is handled. 3.1 will roughly output whatever corresponds to the input and will produce invalid HTML and 3.2 will try to find a representation that produces valid HTML.

In this case, the correct way to handle the misnested lists would be to add a list item before the inner list. You get more or less the same behaviour than in 3.2 but with valid HTML. I have submitted a Pull Request to that effect.

User avatar
canonknipser
Registered User
Posts: 71
Joined: Mon Sep 19, 2011 4:42 am
Location: Germany

Re: [PHPBB-14706] Nested list bbcode renders wrong

Post by canonknipser »

Joshi, thanks for your swift response
Greetings
Frank
phpbb.de support team member - no support via PM or mail
English is not my native language
Extensions and scripts for phpBB

Post Reply