diff --git a/YamlDotNet/Core/EmitterSettings.cs b/YamlDotNet/Core/EmitterSettings.cs index d42ffee7..45fe3150 100644 --- a/YamlDotNet/Core/EmitterSettings.cs +++ b/YamlDotNet/Core/EmitterSettings.cs @@ -95,7 +95,8 @@ public EmitterSettings WithBestIndent(int bestIndent) bestIndent, BestWidth, IsCanonical, - MaxSimpleKeyLength + MaxSimpleKeyLength, + SkipAnchorName ); } @@ -105,7 +106,8 @@ public EmitterSettings WithBestWidth(int bestWidth) BestIndent, bestWidth, IsCanonical, - MaxSimpleKeyLength + MaxSimpleKeyLength, + SkipAnchorName ); } @@ -115,7 +117,8 @@ public EmitterSettings WithMaxSimpleKeyLength(int maxSimpleKeyLength) BestIndent, BestWidth, IsCanonical, - maxSimpleKeyLength + maxSimpleKeyLength, + SkipAnchorName ); } @@ -125,14 +128,20 @@ public EmitterSettings Canonical() BestIndent, BestWidth, true, - MaxSimpleKeyLength + MaxSimpleKeyLength, + SkipAnchorName ); } public EmitterSettings WithoutAnchorName() { - SkipAnchorName = true; - return this; + return new EmitterSettings( + BestIndent, + BestWidth, + IsCanonical, + MaxSimpleKeyLength, + true + ); } public EmitterSettings WithIndentedSequences()