Skip to content

Commit

Permalink
在写入时有限使用 | 而不是 >
Browse files Browse the repository at this point in the history
Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
  • Loading branch information
frg2089 authored Sep 17, 2024
1 parent ee79130 commit 76d7c7b
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 76d7c7b

Please sign in to comment.