Skip to content

Commit

Permalink
Fix input strings with quotes giving "!" tagging artifacts.
Browse files Browse the repository at this point in the history
  • Loading branch information
butataatawa authored and jbeder committed Dec 2, 2016
1 parent 1f4b6d5 commit d025040
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/emitfromevents.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void EmitFromEvents::BeginNode() {
}

void EmitFromEvents::EmitProps(const std::string& tag, anchor_t anchor) {
if (!tag.empty() && tag != "?")
if (!tag.empty() && tag != "?" && tag != "!")
m_emitter << VerbatimTag(tag);
if (anchor)
m_emitter << Anchor(ToString(anchor));
Expand Down
6 changes: 6 additions & 0 deletions test/integration/emitter_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ TEST_F(EmitterTest, SimpleScalar) {
ExpectEmit("Hello, World!");
}

TEST_F(EmitterTest, SimpleQuotedScalar) {
Node n(Load("\"test\""));
out << n;
ExpectEmit("test");
}

TEST_F(EmitterTest, SimpleSeq) {
out << BeginSeq;
out << "eggs";
Expand Down

0 comments on commit d025040

Please sign in to comment.