MCPcopy Index your code
hub / github.com/TruthHun/BookStack / handleA

Function handleA

utils/html2md/html2markdown.go:221–232  ·  view source on GitHub ↗

func handleBlockquote(doc *goquery.Document) *goquery.Document { if tagEle := doc.Find("blockquote"); len(tagEle.Nodes) > 0 { tagEle.Each(func(i int, selection *goquery.Selection) { cont := getInnerHtml(selection) cont = strings.Replace(cont, "\r", "", -1) cont = strings.Replace(cont, "\

(doc *goquery.Document)

Source from the content-addressed store, hash-verified

219
220//[ok]handle tag <a>
221func handleA(doc *goquery.Document) *goquery.Document {
222 doc.Find("a").Each(func(i int, selection *goquery.Selection) {
223 if href, ok := selection.Attr("href"); ok {
224 if cont, err := selection.Html(); err == nil {
225 md := fmt.Sprintf(`[%v](%v)`, cont, href)
226 selection.BeforeHtml(md)
227 selection.Remove()
228 }
229 }
230 })
231 return doc
232}
233
234//[ok]handle tag ul、ol、li
235//处理步骤:

Callers 1

ConvertFunction · 0.85

Calls 1

FindMethod · 0.45

Tested by

no test coverage detected