Skip to content

Commit

Permalink
Merge pull request #281 from ShimakazeProject/frg2089-patch-1
Browse files Browse the repository at this point in the history
在写入时有限使用 | 而不是 >
  • Loading branch information
frg2089 authored Sep 17, 2024
2 parents ee79130 + 76d7c7b commit 47112ad
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Shimakaze.Sdk.Csf.Yaml/Converter/V1/CsfValueConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,19 @@ public void WriteYaml(IEmitter emitter, object? value, Type type, ObjectSerializ
case CsfValue extra when extra.HasExtra:
emitter.Emit(new MappingStart());
emitter.Emit(new Scalar("value"));
emitter.Emit(new Scalar(extra.Value));
emitter.Emit(new Scalar(AnchorName.Empty, TagName.Empty, extra.Value, ScalarStyle.Literal, true, true));
emitter.Emit(new Scalar("extra"));
emitter.Emit(new Scalar(extra.ExtraValue));
emitter.Emit(new MappingEnd());
break;

case CsfValue csfValue when csfValue.Value.Contains('\r') || csfValue.Value.Contains('\n'):
emitter.Emit(new Scalar(AnchorName.Empty, TagName.Empty, csfValue.Value, ScalarStyle.Literal, true, true));
break;

case CsfValue csfValue:
emitter.Emit(new Scalar(csfValue.Value));
break;
}
}
}
}

0 comments on commit 47112ad

Please sign in to comment.