[2.0][2.1] Nested bbc fails to parse correctly

Started by Gwenwyfar, January 27, 2019, 08:48:34 AM

Previous topic - Next topic

Gwenwyfar

... and whether that is a relevant bug or not is to be discussed, but since someone did me the favor of posting something even worse than this example:

test
[/s][/u][/i][/b]

I have not tested what in there makes it break off.
"It is impossible to communicate with one that does not wish to communicate"

Aleksi "Lex" Kilpinen

Not 101% sure, but I'd wager that load of BBC simply can not work together like that, and so this isn't really a bug. I may be wrong too, but I doubt it.

Edit: To clarify, I highly doubt sub and sup work together.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Gwenwyfar

Not sure it checks whether they are "compatible" or not, it just outputs the result. Smaller amounts seem to go just fine.

sup and sub
"It is impossible to communicate with one that does not wish to communicate"

Aleksi "Lex" Kilpinen

Oh, right - It's move. Move should be first and last, in the middle it will break it all. This is to be expected.

test
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Gwenwyfar

blah
[/pre] also seems to break, but this doesn't have move in it and also does:


[list]
[li][list]
[li][list type=decimal]
[li][hr][hr][list type=decimal]
[li][list type=decimal]
[li][hr][list]
[li][list]
[li][list]
[li][list]
[li][list]
[li][list type=decimal]
[li][list type=decimal]
[li][list type=decimal]
[li][list type=decimal]
[li][list type=decimal]
[li][hr][hr][hr][shadow=red,left][glow=red,2,300][glow=red,2,300][glow=red,2,300][s][u][i][b][pre][right][center][center][right][right][right][right][right][font=arial black][font=impact][font=verdana][sup][sup][sup][sub][sub][sub][sub][sub][sub][sub][sub][size=12pt][size=36pt]zoei geral agora[/size][/size][/sub][/sub][/sub][/sub][/sub][/sub][/sub][/sub][/sup][/sup][/sup][/font][/font][/font][/right][/right][/right][/right][/right][/center][/center][/right][/pre][/b][/i][/u][/s][/glow][/glow][/glow][/shadow][/li]
[li][/li]
[/list][/li]
[li][/li]
[/list][/li]
[li][/li]
[/list][/li]
[li][/li]
[/list][/li]
[li][/li]
[/list][/li]
[li][/li]
[/list][/li]
[li][/li]
[/list][/li]
[li][/li]
[/list][/li]
[li][/li]
[/list][/li]
[li][/li]
[/list][/li]
[li][/li]
[/list][/li]
[li][/li]
[/list][/li]
[li][/li]
[/list][/li]
[li][/li]
[/list][/li]
[li][/li]
[/list]

(that is a full post, unedited. Someone give these guys a medal for beta testing everything without any practical purpose. Maybe we should hire them for that).
"It is impossible to communicate with one that does not wish to communicate"

Aleksi "Lex" Kilpinen

Link them to the wiki BBC list, and tell them to read up on differences between inline bbc and block level bbc. :P
Edit: The culprit is "right".
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Arantor

Officially I'd call it "not a bug, this is working as designed" so that invalid HTML can't be produced from invalid nesting.

Gwenwyfar

Quote from: Aleksi "Lex" Kilpinen on January 27, 2019, 09:09:42 AM
Link them to the wiki BBC list, and tell them to read up on differences between inline bbc and block level bbc. :P
Edit: The culprit is "right".
Now you're assuming they give a ******. I was like the fun police for fixing things.

Quote from: Arantor on January 27, 2019, 09:53:08 AM
Officially I'd call it "not a bug, this is working as designed" so that invalid HTML can't be produced from invalid nesting.
Fair enough. Maybe a prettier output though?
"It is impossible to communicate with one that does not wish to communicate"

Arantor

What should it do, though, in terms of prettier output? Right now its current output is to close non-block tags when entering a block tag (meaning the rest of the tags never get parsed because there's no opening tag to match against)

Gwenwyfar

It could move them to close when they actually do, but maybe that gets complicated with the content.
"It is impossible to communicate with one that does not wish to communicate"

Aleksi "Lex" Kilpinen

I'd imagine that could be tricky, at least with larger posts, and would require a whole new logic to be built in where parts of the content are moved around based on a defined set of rules.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Gwenwyfar

Yeah, I guess it falls into "not worth the effort". And realistically, who does that anyway?

Moving this.
"It is impossible to communicate with one that does not wish to communicate"

Arantor

Actually, it can't 'just move them', you'd literally need to rewrite the bbc parser to achieve that.

The parser steps through tag by tag, and adds to a list of currently open tags (with knowledge of block level vs non block level), so to move them around would require rebuilding that model, and doing so at display time rather than save time because you can't guarantee what will still be enabled next time around.

SMF does have some handling in it for tag malfunctions at save time and honestly, it's more trouble than it's worth for the most part (it force-fixes table and list nesting and usually ends up breaking things for the unwary)

Advertisement: