Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BBCode RichTextLabel not working as expected #49914

Closed
MikeSchulze opened this issue Jun 25, 2021 · 6 comments
Closed

BBCode RichTextLabel not working as expected #49914

MikeSchulze opened this issue Jun 25, 2021 · 6 comments

Comments

@MikeSchulze
Copy link

MikeSchulze commented Jun 25, 2021

Godot version

v3.3.stable.official

System information

Windows 10

Issue description

I writing a markdown to BBCode converter and stuck on implementation because of tags not work as expected.
I take a look in the source code and the tags e.g. ul should work but it not works.

https://github.com/godotengine/godot/blob/3.3/scene/gui/rich_text_label.cpp

} else if (tag == "ul") {

			push_list(LIST_DOTS);
			pos = brk_end + 1;
			tag_stack.push_front(tag);
		} else if (tag == "ol") {

			push_list(LIST_NUMBERS);
			pos = brk_end + 1;
			tag_stack.push_front(tag);

I uses this example bbcode to test the tags


[u]test tag u [/u]

[s]test tag s [/s]

[p]test tag p [/p]

[color=red] test tag color[/color]

[bgcolor=red] test tag bgcolor[/bgcolor]

[fgcolor=green] test tag fgcolor[/fgcolor]

[outline_color=green] test tag outline_color[/outline_color]

[indent]test tag indent [/indent]

[ul]test tag ul[/ul]
[ol type=1]test tag ol=1[/ol]
[ol type=a]test tag ol=a[/ol]

The rendered text is:
image

I see also differenzes in 3.3 and 4.0 rich_text_label.cpp implementation.
e.g. i miss support of 'bgcolor' in 3.3

For me looks like the RichTextlabe BBCode support is right in a beta state and not production ready.

Best Regards
Mike

Steps to reproduce

  • put the bbcode on a RichTextLabel

[u]test tag u [/u]

[s]test tag s [/s]

[p]test tag p [/p]

[color=red] test tag color[/color]

[bgcolor=red] test tag bgcolor[/bgcolor]

[fgcolor=green] test tag fgcolor[/fgcolor]

[outline_color=green] test tag outline_color[/outline_color]

[indent]test tag indent [/indent]

[ul]test tag ul[/ul]
[ol type=1]test tag ol=1[/ol]
[ol type=a]test tag ol=a[/ol]

Table support is also very bad

[table=2]
[cell]food[/cell]
[cell]gold[/cell]
[cell]500[/cell]
[cell]5000[/cell]
[/table]

image
And why Godot uses his own bbcode tags and not the official tags?

Minimal reproduction project

No response

@bruvzg
Copy link
Member

bruvzg commented Jun 25, 2021

Lists, bg/fgcolor and table cell borders/backgrounds are implemented only in the master branch.

@Calinou
Copy link
Member

Calinou commented Jun 25, 2021

Lists, bg/fgcolor and table cell borders/backgrounds are implemented only in the master branch.

I guess we can print a warning message if unimplemented tags are used in 3.x.

@MikeSchulze
Copy link
Author

MikeSchulze commented Jun 26, 2021

But i see list is implemented in 3.3

} else if (tag == "ul") {

If there a way to just merge the 4.0 version back to 3.3? I see no conflicts here.

Godot 4.0 is far away you should merge down such enhancments / feature complete back in Godot 3.3.
It is always a pain to strugle un such half gared implementations.

The Goal should be bring Godot 3.x in a good shape, i have the feeling the most manpower gooes to Godot 4.0 and Godot 3.x is a bit neglected.

An another question is why BBCode has his own tag definition?
BBCode has a standard and should also support this
https://www.bbcode.org/reference.php

e.g. the table tags are very specific and Godot and is not the standard.

@bruvzg
Copy link
Member

bruvzg commented Jun 26, 2021

But i see list is implemented in 3.3

The only implemented thing is push_list function (and reading tags to call it), rendering of the ItemList is not.

Godot 4.0 is far away you should merge down such enhancments / feature complete back in Godot 3.3.
It is always a pain to strugle un such half gared implementations.

It's non-trivial task, 4.0 RichTextLabel implementation depends on #41100 which introduce breaking core changes.

The Goal should be bring Godot 3.x in a good shape, i have the feeling the most manpower gooes to Godot 4.0 and Godot 3.x is a bit neglected.

That's the intended way 4.0 is the main focus of development, 3.4 get some new features backported (if it's not breaking changes and easy to port), 3.3 get only bug fixes. See https://docs.godotengine.org/en/latest/about/release_policy.html

An another question is why BBCode has his own tag definition?
BBCode has a standard and should also support this
https://www.bbcode.org/reference.php

We can change it in the 4.0, but this should be discussed in the proposal repository first. Again, it's a breaking change and not suitable for 3.x.

@MikeSchulze
Copy link
Author

@bruvzg thanks for your answer.

I now it is hard to focus to bing Godot 4.0 in a stable position ;)
But it is hard to see Godot 3.x is only mainternace releases e.g. bug fixes.
Godot 4.0 is far away and i not expect that will production ready this year.

Let see ;)
regards
Mike

@Calinou
Copy link
Member

Calinou commented Aug 15, 2022

Closing, as there is nothing actionable within this issue. Efforts to backport new RichTextLabel features in a backwards-compatible way to 3.x are welcome, but this won't be tackled by core contributors as most of them are now focusing their efforts on stabilizing 4.0.

Printing a warning on the use of unknown tags could be considered a breaking change, as some people may be using text [like this] without intending it to be treated as a BBCode tag.

@Calinou Calinou closed this as not planned Won't fix, can't repro, duplicate, stale Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants