Fix SerializeTo not quoting scalar values
This commit is contained in:
parent
174313fe12
commit
c4bd735e59
5
lml.cpp
5
lml.cpp
|
@ -360,12 +360,15 @@ void Lml::Document::SerializeTo(std::string & string, size_t indentation) const
|
||||||
|
|
||||||
if (!scalar.empty())
|
if (!scalar.empty())
|
||||||
{
|
{
|
||||||
|
string.push_back('"');
|
||||||
string.append(scalar[0]);
|
string.append(scalar[0]);
|
||||||
|
string.push_back('"');
|
||||||
|
|
||||||
for (std::string const & scalarString : std::span<std::string const>{scalar.begin() + 1, scalar.end()})
|
for (std::string const & scalarString : std::span<std::string const>{scalar.begin() + 1, scalar.end()})
|
||||||
{
|
{
|
||||||
string.append(", ");
|
string.append(", \"");
|
||||||
string.append(scalarString);
|
string.append(scalarString);
|
||||||
|
string.push_back('"');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue