mirror of
https://github.com/fengxxc/wechatmp2markdown.git
synced 2026-05-08 03:27:40 +08:00
fix: parse "figure" tag
This commit is contained in:
@@ -28,6 +28,8 @@ func parseSection(s *goquery.Selection, imagePolicy ImagePolicy, lastPieceType P
|
|||||||
if sc.Is("a") {
|
if sc.Is("a") {
|
||||||
attr["href"], _ = sc.Attr("href")
|
attr["href"], _ = sc.Attr("href")
|
||||||
pieces = append(pieces, Piece{LINK, removeBrAndBlank(sc.Text()), attr})
|
pieces = append(pieces, Piece{LINK, removeBrAndBlank(sc.Text()), attr})
|
||||||
|
} else if sc.Is("figure") {
|
||||||
|
pieces = append(pieces, parseSection(sc, imagePolicy, _lastPieceType)...)
|
||||||
} else if sc.Is("img") {
|
} else if sc.Is("img") {
|
||||||
attr["src"], _ = sc.Attr("data-src")
|
attr["src"], _ = sc.Attr("data-src")
|
||||||
attr["alt"], _ = sc.Attr("alt")
|
attr["alt"], _ = sc.Attr("alt")
|
||||||
@@ -100,7 +102,7 @@ func parseHeader(s *goquery.Selection) []Piece {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func parsePre(s *goquery.Selection) []Piece {
|
func parsePre(s *goquery.Selection) []Piece {
|
||||||
// print(s.Html())
|
// TODO when include img...
|
||||||
var codeRows []string
|
var codeRows []string
|
||||||
s.Find("code").Each(func(i int, sc *goquery.Selection) {
|
s.Find("code").Each(func(i int, sc *goquery.Selection) {
|
||||||
var codeLine string = ""
|
var codeLine string = ""
|
||||||
|
|||||||
Reference in New Issue
Block a user