Improved handling of trailing document comments

This commit is contained in:
Mike Farah
2022-05-25 10:54:03 +10:00
parent dee592eb3b
commit 6bce23d9c2
9 changed files with 89 additions and 10 deletions
+5
View File
@@ -110,6 +110,11 @@ func (s *streamEvaluator) Evaluate(filename string, reader io.Reader, node *Expr
Node: &dataBucket,
FileIndex: s.fileIndex,
}
//move document comments into candidate node
// otherwise unwrap drops them.
candidateNode.TrailingContent = dataBucket.FootComment
dataBucket.FootComment = ""
if currentIndex == 0 {
candidateNode.LeadingContent = leadingContent
}