Godot: BBcode doesn't work well if the markers are closed in reverse order

Created on 26 Nov 2018  路  5Comments  路  Source: godotengine/godot

Godot version:
3.1 9e62826

OS/device including version:
Windows 10

Issue description:
When my BBcode in RichTextLabel is like below, everything works as I expect:
asfasasfasf

[center][color=green]Ziemniakq[/color][/center]

but when I change text to this, then strange text after my text appear

aaaaaaaa

[center][color=green]Ziemniakq[/center][/color]

Minimal reproduction project:
Test.zip

discussion enhancement gui

Most helpful comment

BBcode on forums doesn't care about order, and it's an easy enough mistake to make.

All 5 comments

But why do you close tags out of order?

BBcode on forums doesn't care about order, and it's an easy enough mistake to make.

Well, forums run on servers with many gigabytes of RAM and many GHz CPUs, and general developers are much more disciplined. I doubt making fuzzy parser for bbcode worth the gain at all. Just my personal opinion.

State of this issue: since 3.2, the MRP with reversed close tags produces "Ziemnikq[/center]", which is a fair improvement on 3.1.

Yes that seems correct to me, unless we aim to explicitly support closing tags in random order, but I don't think it's necessary.

Was this page helpful?
0 / 5 - 0 ratings