(tag string)
| 567 | } |
| 568 | |
| 569 | func isBlockElement(tag string) bool { |
| 570 | switch tag { |
| 571 | case "p", "div", "h1", "h2", "h3", "h4", "h5", "h6", |
| 572 | "ul", "ol", "li", "table", "tr", "br", "hr", |
| 573 | "blockquote", "pre", "article", "section", "main", |
| 574 | "header", "footer", "nav", "aside", "details": |
| 575 | return true |
| 576 | } |
| 577 | return false |
| 578 | } |
| 579 | |
| 580 | func stripHTMLTags(s string) string { |
| 581 | re := regexp.MustCompile(`<[^>]*>`) |