From c4bd735e59833f0c287a8adcb915cbb9f9cc1cca Mon Sep 17 00:00:00 2001 From: kayomn Date: Thu, 6 Jul 2023 00:54:36 +0100 Subject: [PATCH] Fix SerializeTo not quoting scalar values --- lml.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lml.cpp b/lml.cpp index ce0ac0e..2e9aece 100644 --- a/lml.cpp +++ b/lml.cpp @@ -360,12 +360,15 @@ void Lml::Document::SerializeTo(std::string & string, size_t indentation) const if (!scalar.empty()) { + string.push_back('"'); string.append(scalar[0]); + string.push_back('"'); for (std::string const & scalarString : std::span{scalar.begin() + 1, scalar.end()}) { - string.append(", "); + string.append(", \""); string.append(scalarString); + string.push_back('"'); } }