ignore script tags and such when extracting text
parent
ab1da46096
commit
2182e4e739
|
@ -193,6 +193,8 @@ func text(s *goquery.Selection) string {
|
|||
} else if n.Type == html.ElementNode && n.DataAtom == atom.P && n.PrevSibling != nil {
|
||||
//buf.WriteString("\n\n")
|
||||
buf.WriteString(" ")
|
||||
} else if n.Type == html.ElementNode && (n.DataAtom == atom.Script || n.DataAtom == atom.Style || n.DataAtom == atom.Template) {
|
||||
// nothing
|
||||
}
|
||||
if n.FirstChild != nil {
|
||||
for c := n.FirstChild; c != nil; c = c.NextSibling {
|
||||
|
|
Loading…
Reference in New Issue