From ea45ea5146cb192930279d266104100bc7702158 Mon Sep 17 00:00:00 2001 From: fengxxc Date: Thu, 26 Sep 2024 16:03:54 +0800 Subject: [PATCH] fix: parse "figure" tag --- parse/parse.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/parse/parse.go b/parse/parse.go index 495ae86..7c8c60c 100644 --- a/parse/parse.go +++ b/parse/parse.go @@ -28,6 +28,8 @@ func parseSection(s *goquery.Selection, imagePolicy ImagePolicy, lastPieceType P if sc.Is("a") { attr["href"], _ = sc.Attr("href") 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") { attr["src"], _ = sc.Attr("data-src") attr["alt"], _ = sc.Attr("alt") @@ -100,7 +102,7 @@ func parseHeader(s *goquery.Selection) []Piece { } func parsePre(s *goquery.Selection) []Piece { - // print(s.Html()) + // TODO when include img... var codeRows []string s.Find("code").Each(func(i int, sc *goquery.Selection) { var codeLine string = ""