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 tags are closed prematurely in "print_rich()" method if the provided text contains "\n" in it #80001

Closed
TheRealSlander opened this issue Jul 29, 2023 · 2 comments · Fixed by #80476

Comments

@TheRealSlander
Copy link

Godot version

4.2.dev1

System information

Manjaro Linux (DE: Cinnamon v5.8.4) 64 bits

Issue description

The title already explains it. Take a look at the steps to reproduce below.

Steps to reproduce

In a GDScript _ready() function write this:
print_rich("[color=red]Red line\n2nd red line[/color]")

the second line is not red and the output is as follow:
Capture d’écran du 2023-07-29 05-50-16

I tested all the the possible BBCodes for the print_rich() method (as stated in the documentation), and of course they all failed.

The RichTextLabel in my projects works as expected.

Minimal reproduction project

N/A

@AThousandShips
Copy link
Member

AThousandShips commented Jul 29, 2023

This is by design, in #79011, but needs to be documented, this is because it splits lines for processing messages correctly, so might be an unforeseen consequence of two different behaviors merging (and assumptions that print_rich should contain a single line), but the behavior is there to prevent errors in the output, so unsure how it should be solved other than documenting it

@AThousandShips AThousandShips added this to the 4.x milestone Jul 29, 2023
@AThousandShips
Copy link
Member

CC @bruvzg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants