mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 12:41:17 +00:00
Forced literal scalars to use long keys
This commit is contained in:
@@ -536,11 +536,14 @@ namespace YAML
|
|||||||
if(!good())
|
if(!good())
|
||||||
return *this;
|
return *this;
|
||||||
|
|
||||||
PrepareNode(EmitterNodeType::Scalar);
|
|
||||||
|
|
||||||
const bool escapeNonAscii = m_pState->GetOutputCharset() == EscapeNonAscii;
|
const bool escapeNonAscii = m_pState->GetOutputCharset() == EscapeNonAscii;
|
||||||
const StringFormat::value strFormat = Utils::ComputeStringFormat(str, m_pState->GetStringFormat(), m_pState->CurGroupFlowType(), 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) {
|
switch(strFormat) {
|
||||||
case StringFormat::Plain:
|
case StringFormat::Plain:
|
||||||
m_stream << str;
|
m_stream << str;
|
||||||
|
Reference in New Issue
Block a user