Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

Add `\n` to doc comments on empty line

Cyril Bissey784964f99a24
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index 8607b374e8a..b0b878a7826 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -3941,6 +3941,8 @@ static void _process_doc_line(const String &p_line, String &r_text, const String
// We want to replace `[br][br]` with `\n` (paragraph), so we move the trailing `[br]` here.
r_text = r_text.left(-4); // `-len("[br]")`.
line = "[br]" + line;
+ } else if (!r_text.ends_with("\n") && line.is_empty()) {
+ line_join = "\n";
} else if (!r_text.ends_with("\n")) {
line_join = " ";
}