Skip to content

Commit

Permalink
Add warning to Node.Text GoDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
yuin committed Oct 15, 2024
1 parent ad15651 commit 65dcf6c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ast/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ type Node interface {
Dump(source []byte, level int)

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

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

0 comments on commit 65dcf6c

Please sign in to comment.