Merge pull request #117008 from dalexeev/editor-help-fix-links-after-codeblocks

Editor Help: Start new paragraphs after codeblocks
This commit is contained in:
Thaddeus Crews 2026-03-04 11:20:40 -06:00
commit eb516e3d12
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC

View file

@ -2793,8 +2793,12 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt, const C
// Compensate for `\n` removed before the loop.
if (pos < bbcode.length()) {
// `\n` starts a new paragraph, `\r` just adds a break to existing one.
p_rt->add_text("\r");
if (bbcode.substr(pos, 10) == "[codeblock") {
// `\n` starts a new paragraph, `\r` just adds a break to existing one.
p_rt->add_text("\r");
} else {
p_rt->add_newline();
}
}
} else if (tag == "kbd") {
int end_pos = bbcode.find("[/kbd]", brk_end + 1);