Scripting: Fix value docstrings with newlines

This commit is contained in:
Vicki Pfau 2022-09-29 03:27:26 -07:00
parent 6fc8195177
commit e4a5a3f2db
1 changed files with 6 additions and 1 deletions

View File

@ -301,7 +301,12 @@ void explainValueScoped(struct mScriptValue* value, const char* name, const char
}
}
if (docstring) {
fprintf(out, "%scomment: \"%s\"\n", indent, docstring);
if (strchr(docstring, '\n')) {
fprintf(out, "%scomment: |-\n", indent);
printchomp(docstring, level + 1);
} else {
fprintf(out, "%scomment: \"%s\"\n", indent, docstring);
}
}
switch (value->type->base) {