From bb2d3e26ea6caa5dfa037c19c05e68108648ba2f Mon Sep 17 00:00:00 2001 From: gutmet Date: Sun, 13 Jan 2019 19:01:48 +0100 Subject: [PATCH] export text and firsttext functions --- html.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/html.go b/html.go index 1c84142..6517746 100644 --- a/html.go +++ b/html.go @@ -79,7 +79,7 @@ func (n *HtmlNode) GetElementsByClass(class string) []*HtmlNode { } } -func (n *HtmlNode) text() string { +func (n *HtmlNode) Text() string { if n == nil { return "" } @@ -98,7 +98,7 @@ func (n *HtmlNode) text() string { } } -func (n *HtmlNode) firstText() string { +func (n *HtmlNode) FirstText() string { text := n.Find(func(n *HtmlNode) bool { return n.Type == html.TextNode }) return strings.TrimSpace(text.Data) }