Simple Machines Community Forum

SMF Development => Bug Reports => Fixed or Bogus Bugs => Topic started by: Gwenwyfar on January 27, 2019, 08:48:34 AM

Title: [2.0][2.1] Nested bbc fails to parse correctly
Post by: Gwenwyfar on January 27, 2019, 08:48:34 AM
... 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.
Title: Re: [2.0][2.1] Nested bbc fails to parse correctly
Post by: Aleksi "Lex" Kilpinen on January 27, 2019, 08:54:36 AM
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.
Title: Re: [2.0][2.1] Nested bbc fails to parse correctly
Post by: Gwenwyfar on January 27, 2019, 09:01:15 AM
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
Title: Re: [2.0][2.1] Nested bbc fails to parse correctly
Post by: Aleksi "Lex" Kilpinen on January 27, 2019, 09:04:03 AM
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
Title: Re: [2.0][2.1] Nested bbc fails to parse correctly
Post by: Gwenwyfar on January 27, 2019, 09:08:16 AM
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).
Title: Re: [2.0][2.1] Nested bbc fails to parse correctly
Post by: 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".
Title: Re: [2.0][2.1] Nested bbc fails to parse correctly
Post by: 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.
Title: Re: [2.0][2.1] Nested bbc fails to parse correctly
Post by: Gwenwyfar on January 27, 2019, 10:13:09 AM
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?
Title: Re: [2.0][2.1] Nested bbc fails to parse correctly
Post by: Arantor on January 27, 2019, 10:58:25 AM
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)
Title: Re: [2.0][2.1] Nested bbc fails to parse correctly
Post by: Gwenwyfar on January 27, 2019, 11:48:59 AM
It could move them to close when they actually do, but maybe that gets complicated with the content.
Title: Re: [2.0][2.1] Nested bbc fails to parse correctly
Post by: Aleksi "Lex" Kilpinen on January 27, 2019, 12:04:37 PM
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.
Title: Re: [2.0][2.1] Nested bbc fails to parse correctly
Post by: Gwenwyfar on January 27, 2019, 12:07:06 PM
Yeah, I guess it falls into "not worth the effort". And realistically, who does that anyway?

Moving this.
Title: Re: [2.0][2.1] Nested bbc fails to parse correctly
Post by: Arantor on January 27, 2019, 12:46:38 PM
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)