godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.15k stars 20.21k forks source link

bbcode `color` behaves incorrectly next to a `table` #80908

Open kimkanu opened 1 year ago

kimkanu commented 1 year ago

Godot version

4.2.dev3

System information

Godot v4.2.dev3 - macOS 13.4.0 - Vulkan (Mobile) - integrated Apple M1 - Apple M1 (8 Threads)

Issue description

[color=#ff0]YELLOW[/color]___NO TABLE___[color=#f03]RED[/color]

[color=#ff0]YELLOW[/color]___[table=1][cell]TABLE[/cell][/table]___[color=#f03]RED[/color]

Result:

image

Probably tags like [table=1], [cell] are counted as letters, and it colors wrong letters.

Steps to reproduce

Create a RichTextLabel with bbcode enabled, and set the text as above.

Minimal reproduction project

Reproduction is super easy

jsjtxietian commented 1 year ago

This works 'correctly', looks like it's coloring the 8th element after the yellow one, desipte the content of this table. Interesting. [color=#ff0]YELLOW[/color]___[table=1][cell]4[/cell][/table]___[color=#f03]RED[/color]