From 7719dd5ec4195fb4eb6f0b28a8a5e50f84c8a521 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Thu, 29 Sep 2022 02:52:57 -0700 Subject: [PATCH] Scripting: Fix member docstrings with newlines --- src/script/docgen.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/script/docgen.c b/src/script/docgen.c index 569d06e51..ba740e6aa 100644 --- a/src/script/docgen.c +++ b/src/script/docgen.c @@ -230,7 +230,12 @@ void explainClass(struct mScriptTypeClass* cls, int level) { case mSCRIPT_CLASS_INIT_INSTANCE_MEMBER: fprintf(out, "%s %s:\n", indent, details->info.member.name); if (docstring) { - fprintf(out, "%s comment: \"%s\"\n", indent, docstring); + if (strchr(docstring, '\n')) { + fprintf(out, "%s comment: |-\n", indent); + printchomp(docstring, level + 3); + } else { + fprintf(out, "%s comment: \"%s\"\n", indent, docstring); + } docstring = NULL; } fprintf(out, "%s type: %s\n", indent, details->info.member.type->name);