As designed Bug spoiler

Affected version
2.1.6
Hello.

Please pay attention. If so conceived, please explain.
Example: (Just copy the code and paste it into the message, see for yourself.)
Code:
[CENTER][SPOILER="Test spoiler"]Test[/CENTER]
Test 2[/SPOILER]
We write two lines in a row.

The first line is shifted to the center.
The second line is unchanged.

Take it all under the spoiler, call it what you want.

We get that the text alignment tag works incorrectly and our spoiler duplicates the first line. The problem appeared after the update to 2.1.4. The new version 2.1.6 does not fix it. Checked on a clean new version, all the same.

The problem here is that when we take the text under the spoiler that follows the CENTER tag. The tag CENTER goes behind the spoiler, thus causing a double spoiler, but it should be inside the spoiler. There's definitely some confusion in the tags when it try to automatically align.

When he has to go like this:
Code:
[SPOILER="Test spoiler"][CENTER]Test[/CENTER]
Test 2[/SPOILER]
Please check.

Below is a living example. You have the same problem:

Test
Test 2
 
Last edited:

Chris D

XenForo developer
Staff member
The BB code as written would produce invalid HTML.

The spoiler tag starts inside the center tag and closes outside, hence it would produce invalid HTML. In some cases this would cause weird behaviour, in worse cases invalid HTML could break the entire output of the page.

As such, when we face BB code which may cause invalid HTML, we attempt to fix it. In this case, it produces valid HTML, but it clearly doesn't produce a desired result. This is acceptable, working as designed, and better than the alternative which could well cause problems, so we won't be making any changes here.
 
Top