diff --git a/src/emitterutils.cpp b/src/emitterutils.cpp index 57f41ac38..d248ab6bb 100644 --- a/src/emitterutils.cpp +++ b/src/emitterutils.cpp @@ -416,7 +416,6 @@ bool WriteLiteralString(ostream_wrapper& out, const char* str, std::size_t size, size -= 1; } else { // 'keep' out << "|+\n"; - size -= 1; } int codePoint; for (const char* i = str; diff --git a/test/integration/emitter_test.cpp b/test/integration/emitter_test.cpp index 8dc3d6d26..8085a7012 100644 --- a/test/integration/emitter_test.cpp +++ b/test/integration/emitter_test.cpp @@ -454,6 +454,7 @@ TEST_F(EmitterTest, LiteralWithAndWithoutTrailingEmptyLines) { out << BeginSeq; out << Literal << "A\nB"; out << Literal << "A\nB\n"; + out << Literal << "A\nB\n\n"; out << Literal << "A\nB\n\n\n"; out << "something"; out << EndSeq; @@ -462,6 +463,7 @@ TEST_F(EmitterTest, LiteralWithAndWithoutTrailingEmptyLines) { "- |-\n A\n B\n" "- |\n A\n B\n" "- |+\n A\n B\n\n\n" + "- |+\n A\n B\n\n\n\n" "- something"); }