Skip to content

Commit 209e95c

Browse files
committed
兼容以前的接口
1 parent 0e27912 commit 209e95c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

controllers/api/CommonController.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -862,8 +862,11 @@ func (this *CommonController) handleReleaseV1(release string, bookIdentify strin
862862
} else {
863863
// 处理svg
864864
query = utils.HandleSVG(query, bookIdentify)
865+
query.Find(".reference-link").Remove()
866+
query.Find(".header-link").Remove()
867+
865868
allTags := make(map[string]bool)
866-
query.Find("*").Each(func(i int, selection *goquery.Selection) {
869+
query.Find("body").Find("*").Each(func(i int, selection *goquery.Selection) {
867870
if len(selection.Nodes) > 0 {
868871
allTags[strings.ToLower(selection.Nodes[0].Data)] = true
869872
}
@@ -882,9 +885,6 @@ func (this *CommonController) handleReleaseV1(release string, bookIdentify strin
882885
}
883886
}
884887

885-
query.Find(".reference-link").Remove()
886-
query.Find(".header-link").Remove()
887-
888888
weixinTagsMap.Range(func(tag, value interface{}) bool {
889889
t := tag.(string)
890890
query.Find(t).AddClass("-" + t).RemoveAttr("id")
@@ -897,7 +897,7 @@ func (this *CommonController) handleReleaseV1(release string, bookIdentify strin
897897
}
898898
})
899899

900-
htmlStr, err = query.Html()
900+
htmlStr, err = query.Find("body").Html()
901901
if err != nil {
902902
beego.Error(err)
903903
}

0 commit comments

Comments
 (0)