Skip to content

Commit

Permalink
Write '' in place of empty strings
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchLeaders committed Jan 13, 2024
1 parent 859b9c6 commit 3626d65
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/BymlLibrary/Yaml/YamlEmitter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ public void EmitNode(in ImmutableByml byml, in ImmutableByml root)

public unsafe void EmitString(Span<byte> str)
{
if (str.IsEmpty) {
Builder.Append("''");
}

if (str.ContainsAny(SpecialChars)) {
Builder.Append('\'');
Builder.Append(str.ToManaged());
Expand Down

0 comments on commit 3626d65

Please sign in to comment.