Output document end marker after open ended scalars (#162)

This commit is contained in:
Tina Müller (tinita)
2020-03-28 18:06:58 +01:00
committed by GitHub
parent 9afa10a8b0
commit fa1293a11f
+12
View File
@@ -652,6 +652,18 @@ yaml_emitter_emit_document_start(yaml_emitter_t *emitter,
else if (event->type == YAML_STREAM_END_EVENT)
{
/**
* This can happen if a block scalar with trailing empty lines
* is at the end of the stream
*/
if (emitter->open_ended)
{
if (!yaml_emitter_write_indicator(emitter, "...", 1, 0, 0))
return 0;
emitter->open_ended = 0;
if (!yaml_emitter_write_indent(emitter))
return 0;
}
if (!yaml_emitter_flush(emitter))
return 0;