Skip to content

Commit 65dcf6c

Browse files
committed
Add warning to Node.Text GoDoc
1 parent ad15651 commit 65dcf6c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ast/ast.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ type Node interface {
123123
Dump(source []byte, level int)
124124

125125
// Text returns text values of this node.
126+
// This method is valid only for some inline nodes.
127+
// If this node is a block node, Text returns a text value as reasonable as possible.
128+
// Notice that there are no 'correct' text values for the block nodes.
129+
// Result for the block nodes may be different from your expectation.
126130
Text(source []byte) []byte
127131

128132
// HasBlankPreviousLines returns true if the row before this node is blank,

0 commit comments

Comments
 (0)