Allows root tag to be serialized without a name
This commit is contained in:
parent
d885485684
commit
396c660113
1 changed files with 8 additions and 4 deletions
|
@ -86,10 +86,14 @@ abstract class Tag {
|
||||||
if (tag.getType() != 0) {
|
if (tag.getType() != 0) {
|
||||||
if (!builder.isEmpty) {
|
if (!builder.isEmpty) {
|
||||||
// Write name
|
// Write name
|
||||||
if (tag.shouldQuoteName()) {
|
if (tag._key == "") {
|
||||||
builder.append("${"".padLeft(indents, "\t")}\"${tag.getKey()}\": ");
|
builder.append("${"".padLeft(indents, '\t')}");
|
||||||
} else
|
} else {
|
||||||
builder.append("${"".padLeft(indents, '\t')}${tag.getKey()}: ");
|
if (tag.shouldQuoteName()) {
|
||||||
|
builder.append("${"".padLeft(indents, "\t")}\"${tag.getKey()}\": ");
|
||||||
|
} else
|
||||||
|
builder.append("${"".padLeft(indents, '\t')}${tag.getKey()}: ");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tag.writeStringifiedValue(builder, indents + 1, false);
|
tag.writeStringifiedValue(builder, indents + 1, false);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue