Fix stringified value and key writing for quotes

This commit is contained in:
zontreck 2024-07-02 20:27:41 -07:00
parent 8077bbfa1f
commit 3e7bae969e
3 changed files with 21 additions and 3 deletions

View file

@ -36,7 +36,10 @@ class StringTag extends Tag {
@override
void writeStringifiedValue(StringBuilder builder, int indent, bool isList) {
builder.append("${isList ? "".padLeft(indent, '\t') : ""}\"${value}\"");
if (shouldQuote(value))
builder.append("${isList ? "".padLeft(indent, '\t') : ""}\"${value}\"");
else
builder.append("${isList ? "".padLeft(indent, '\t') : ""}${value}");
}
@override