Design issue Insertion of extra quote tag when placed inside a bold tag

Biker

Well-known member
This one drove me absolutely nuts, and after several edits, finally figured out there's a bug.

If you place a quote tag after a bold tag, XF inserts extra quote tags, creating two quotes.

[b][quote]This is a test[/b]

Line 1

Line 2

Line 3

Line 4[/quote]

Turns into:

This is a test
Line 1

Line 2

Line 3

Line 4
 
Last edited:
Personally speaking, this is roughly what I would expect to happen, or a similar variant.

If you wrote out something similar in HTML it would be invalid. If we rendered it to HTML as written, it would be invalid. Therefore this is likely just a result of us working around the faulty syntax and making it so it is valid.

I'm not convinced there's a solution that's more desirable (or even possible) than the current one.
 
Ugh.

This occurred after a copy/paste from another site and I threw quote tags at the beginning/end. But the actual placement occurred inside the bold tag.

Guess this will be something to just keep an eye on in the future, especially if some members run into a problem with it.
 
Well, that might be a different scenario that we might be able to clean up. Not closing the bug, yet, we will take a closer look and workaround it if we can :)
 
Realistically, I don't think anything will change here: it's a consequence of fixing the structure of the BB code. You'll see HTML do some similar things if tags are misnested.

Since the B tag is opened before the QUOTE tag but it's closed first, we resolve this by (automatically) closing the QUOTE, closing the B (as was written) and then (automatically) reopening the QUOTE. There isn't a particularly easy way of resolving this without creating a second quote. (The nesting has to be valid to be rendered.) If you parsed in an opposite approach, the issue still exists -- it just gets triggered with the opposite order of tags.

This is really as designed because the nesting resolution is definitely intentional and important, but this specific rendering isn't really intentional. It's sort of more of a design issue in that regard.
 
Back
Top Bottom