### 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](https://github.com/godotengine/godot/assets/102065761/554038c6-d128-40c9-8c88-237b44b35b12)

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
search_box = memnew(LineEdit);
	search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL);
	search_box->set_placeholder(TTR("Filter Messages"));
	search_box->set_clear_button_enabled(true);
	search_box->set_visible(true);
	search_box->connect("text_changed", callable_mp(this, &EditorLog::_search_changed));
	vb_left->add_child(search_box);
	VBoxContainer *vb_right = memnew(VBoxContainer);
	hb->add_child(vb_right);
	
	HBoxContainer *hb_tools = memnew(HBoxContainer);
	hb_tools->set_h_size_flags(SIZE_SHRINK_CENTER);
	vb_right->add_child(hb_tools);
	
	clear_button = memnew(Button);
	clear_button->set_flat(true);
	clear_button->set_focus_mode(FOCUS_NONE);
	clear_button->set_shortcut(ED_SHORTCUT("editor/clear_output", TTR("Clear Output"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::K));
	clear_button->set_shortcut_context(this);
	clear_button->connect("pressed", callable_mp(this, &EditorLog::_clear_request));
	hb_tools->add_child(clear_button);
	
	copy_button = memnew(Button);
	copy_button->set_flat(true);
	copy_button->set_focus_mode(FOCUS_NONE);
	copy_button->set_shortcut(ED_SHORTCUT("editor/copy_output", TTR("Copy Selection"), KeyModifierMask::CMD_OR_CTRL | Key::C));
	copy_button->set_shortcut_context(this);
	copy_button->connect("pressed", callable_mp(this, &EditorLog::_copy_request));
	hb_tools->add_child(copy_button);