diff --git a/src/node.cpp b/src/node.cpp index a7a3573..23df5a3 100644 --- a/src/node.cpp +++ b/src/node.cpp @@ -136,7 +136,11 @@ namespace YAML // write tag if(m_tag != "") { - out << std::string("!<") << m_tag << std::string("> "); + // put the tag in the "proper" brackets + if(m_tag.substr(0, 2) == "!<" && m_tag.substr(m_tag.size() - 1) == ">") + out << m_tag; + else + out << std::string("!<") << m_tag << std::string("> "); startedLine = true; onlyOneCharOnLine = false; } diff --git a/yaml-reader/tests/directives.yaml b/yaml-reader/tests/directives.yaml index adc9130..5e81cdd 100644 --- a/yaml-reader/tests/directives.yaml +++ b/yaml-reader/tests/directives.yaml @@ -2,4 +2,4 @@ %TAG ! !howdy --- - basic node -- ! yeah baby \ No newline at end of file +- ! yeah baby