(doc *goquery.Document)
| 313 | } |
| 314 | |
| 315 | func handleTag2Tag(doc *goquery.Document) *goquery.Document { |
| 316 | for tag, toTag := range tag2tag { |
| 317 | doc.Find(tag).Each(func(i int, selection *goquery.Selection) { |
| 318 | if text, _ := selection.Html(); strings.TrimSpace(text) != "" { |
| 319 | selection.BeforeHtml(fmt.Sprintf("<%v>%v</%v>", toTag, text, toTag)) |
| 320 | } |
| 321 | selection.Remove() |
| 322 | }) |
| 323 | } |
| 324 | return doc |
| 325 | } |
| 326 | |
| 327 | func handleNextLine(doc *goquery.Document) *goquery.Document { |
| 328 | for _, tag := range nextlineTag { |