Skip to content

Commit

Permalink
Merge pull request aaubry#347 from szilvaa/master
Browse files Browse the repository at this point in the history
Fix roundtripping of tags on sequences
  • Loading branch information
aaubry authored Oct 9, 2018
2 parents 90f71d0 + 251d134 commit f9228aa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public void ScalarIsSerializable(string yaml, string expectedValue)
[InlineData("[a]", new[] { "a" })]
[InlineData("['a']", new[] { "a" })]
[InlineData("- a\r\n- b", new[] { "a", "b" })]
[InlineData("!bla [a]", new[] { "a" })]
public void SequenceIsSerializable(string yaml, string[] expectedValues)
{
var deserializer = new Deserializer();
Expand Down
2 changes: 1 addition & 1 deletion YamlDotNet/RepresentationModel/YamlSequenceNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ internal override void ResolveAliases(DocumentLoadingState state)
/// <param name="state">The state.</param>
internal override void Emit(IEmitter emitter, EmitterState state)
{
emitter.Emit(new SequenceStart(Anchor, Tag, true, Style));
emitter.Emit(new SequenceStart(Anchor, Tag, string.IsNullOrEmpty(Tag), Style));
foreach (var node in children)
{
node.Save(emitter, state);
Expand Down

0 comments on commit f9228aa

Please sign in to comment.