Skip to content

Commit 3eaee44

Browse files
committed
Indicate quoted strings via explicit standard tag.
1 parent 4735f26 commit 3eaee44

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/prologue/yaml-cpp/src/singledocparser.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,11 @@ void SingleDocParser::HandleNode(EventHandler& eventHandler) {
9191
const Token& token = m_scanner.peek();
9292

9393
// add non-specific tags
94-
if (tag.empty())
94+
if (tag.empty()){
9595
tag = (token.type == Token::NON_PLAIN_SCALAR ? "!" : "?");
96+
if (tag == "!")
97+
tag = "tag:yaml.org,2002:str"; // explicitly indicate string by tag
98+
}
9699

97100
if (token.type == Token::PLAIN_SCALAR
98101
&& tag.compare("?") == 0 && IsNullString(token.value)) {

0 commit comments

Comments
 (0)