From 5856918528d1f9881d40d0cf7a13342bda4add9b Mon Sep 17 00:00:00 2001 From: Gabe Cook Date: Wed, 18 May 2022 16:42:31 -0500 Subject: [PATCH] Encode `ast.StringNode` line comment after header --- ast/ast.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ast/ast.go b/ast/ast.go index 415fad41..59b8e528 100644 --- a/ast/ast.go +++ b/ast/ast.go @@ -829,6 +829,9 @@ func (n *StringNode) String() string { // This block assumes that the line breaks in this inside scalar content and the Outside scalar content are the same. // It works mostly, but inconsistencies occur if line break characters are mixed. header := token.LiteralBlockHeader(n.Value) + if n.Comment != nil { + header = addCommentString(header, n.Comment) + } space := strings.Repeat(" ", n.Token.Position.Column-1) values := []string{} for _, v := range strings.Split(n.Value, lbc) {