From faa2e50605f7ed8d46ff1474c1f75f48a4059fdf Mon Sep 17 00:00:00 2001 From: Jesse Beder Date: Tue, 22 May 2012 15:07:11 -0500 Subject: [PATCH] Forced literal scalars to use long keys --- src/emitter.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/emitter.cpp b/src/emitter.cpp index 6ca4b42..a6fdd50 100644 --- a/src/emitter.cpp +++ b/src/emitter.cpp @@ -536,11 +536,14 @@ namespace YAML if(!good()) return *this; - PrepareNode(EmitterNodeType::Scalar); - const bool escapeNonAscii = m_pState->GetOutputCharset() == EscapeNonAscii; const StringFormat::value strFormat = Utils::ComputeStringFormat(str, m_pState->GetStringFormat(), m_pState->CurGroupFlowType(), escapeNonAscii); + if(strFormat == StringFormat::Literal) + m_pState->SetMapKeyFormat(YAML::LongKey, FmtScope::Local); + + PrepareNode(EmitterNodeType::Scalar); + switch(strFormat) { case StringFormat::Plain: m_stream << str;