From ad2b9fbaaf1a36d3645417b9ac657b053635b4dd Mon Sep 17 00:00:00 2001 From: jbeder Date: Thu, 20 Nov 2008 04:12:31 +0000 Subject: [PATCH] Fixed tag output bug --- src/node.cpp | 6 +++++- yaml-reader/tests/directives.yaml | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) 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