Allows root tag to be serialized without a name

This commit is contained in:
zontreck 2024-06-06 10:35:26 -07:00
parent d885485684
commit 396c660113

View file

@ -86,10 +86,14 @@ abstract class Tag {
if (tag.getType() != 0) {
if (!builder.isEmpty) {
// Write name
if (tag.shouldQuoteName()) {
builder.append("${"".padLeft(indents, "\t")}\"${tag.getKey()}\": ");
} else
builder.append("${"".padLeft(indents, '\t')}${tag.getKey()}: ");
if (tag._key == "") {
builder.append("${"".padLeft(indents, '\t')}");
} else {
if (tag.shouldQuoteName()) {
builder.append("${"".padLeft(indents, "\t")}\"${tag.getKey()}\": ");
} else
builder.append("${"".padLeft(indents, '\t')}${tag.getKey()}: ");
}
}
tag.writeStringifiedValue(builder, indents + 1, false);