feat: Add Node#TrimmedText

This commit is contained in:
ptrcnull 2022-07-08 00:32:27 +02:00
parent 5ab9ae9ca3
commit f84ae8d1fd
1 changed files with 4 additions and 0 deletions

View File

@ -185,6 +185,10 @@ func (n *Node) Text() string {
return res
}
func (n *Node) TrimmedText() string {
return strings.Trim(n.Text(), " \n\t")
}
func (n *Node) Render() (string, error) {
w := bytes.NewBuffer([]byte{})
err := html.Render(w, n.Node)