Skip to content

Commit

Permalink
+ Save double quotes around strings (and only them!) when dumping node
Browse files Browse the repository at this point in the history
  • Loading branch information
nikich340 committed Feb 16, 2021
1 parent 028dceb commit 468e083
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/emitfromevents.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ void EmitFromEvents::OnScalar(const Mark&, const std::string& tag,
anchor_t anchor, const std::string& value) {
BeginNode();
EmitProps(tag, anchor);
m_emitter << value;

if (tag == "!") {
m_emitter << DoubleQuoted << value;
} else {
m_emitter << value;
}
}

void EmitFromEvents::OnSequenceStart(const Mark&, const std::string& tag,
Expand Down

0 comments on commit 468e083

Please sign in to comment.