Skip to content

Commit 202c0fc

Browse files
committed
Fix format for sequence with anchor
1 parent 73f469a commit 202c0fc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ast/ast.go

+2
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,8 @@ func (n *AnchorNode) String() string {
873873
value := n.Value.String()
874874
if len(strings.Split(value, "\n")) > 1 {
875875
return fmt.Sprintf("&%s\n%s", n.Name.String(), value)
876+
} else if _, ok := n.Value.(*SequenceNode); ok {
877+
return fmt.Sprintf("&%s\n%s", n.Name.String(), value)
876878
}
877879
return fmt.Sprintf("&%s %s", n.Name.String(), value)
878880
}

0 commit comments

Comments
 (0)