[PHPBB-14706] Nested list bbcode renders wrong

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

[PHPBB-14706] Nested list bbcode renders wrong

Post by canonknipser » Tue Jul 05, 2016 11:49 am

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 3712 times
Greetings, Frank

english is not my native language

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

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

Post by Jacob » Tue Jul 05, 2016 12:44 pm

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: 59
Joined: Mon Sep 19, 2011 4:42 am
Location: Germany

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

Post by canonknipser » Tue Jul 05, 2016 1:21 pm

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

english is not my native language

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

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

Post by JoshyPHP » Fri Jul 08, 2016 10:00 am

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: 59
Joined: Mon Sep 19, 2011 4:42 am
Location: Germany

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

Post by canonknipser » Mon Jul 11, 2016 6:34 pm

Joshi, thanks for your swift response
Greetings, Frank

english is not my native language

Post Reply