Design issue Spoiler BB code duplicated when used in combination with inline BB codes

Steffen

Well-known member
Affected version
2.0.10
Enter the following BB code:
Code:
[B]Line 1[/B]
Line 2
[B]Line 3[/B]

(And switch back to WYSIWYG mode if you've used plaintext mode to enter this BB code.)

Now select all (Ctrl+A) and click the editor button Insert → Spoiler → Continue.

The result looks like this:

Screenshot from 2018-11-05 08-30-51.webp

Clicking the preview button now results in two spoiler buttons:

Screenshot from 2018-11-05 08-31-49.webp

Furthermore, toggling the BB code mode twice has the following result:

Screenshot from 2018-11-05 08-32-31.webp

This may be just one example of a more general issue: Probably block BB codes like "spoiler" should not get wrapped by inline BB codes like "b"?
 
Realistically, we aren't likely to change anything here at this time. This can happen with assorted tags, but it's essentially a byproduct of mis-nesting of tags and how this gets resolved at run time. In many cases, this resolution gives exactly the desired output, so the alternative (which would probably be to disable parsing) is very likely to end up worse (and also be a big BC break for existing content).
 
Top Bottom