mirror of
https://github.com/fengxxc/wechatmp2markdown.git
synced 2026-03-04 11:40:47 +08:00
feat: 支持解析表格(简单粗暴的原生html方式)
This commit is contained in:
@@ -174,7 +174,7 @@ func formatContent(pieces []parse.Piece, depth int) (string, map[string][]byte)
|
||||
pieceMdStr = formatImageRefer(piece, len(base64Imgs))
|
||||
base64Imgs = append(base64Imgs, piece.Val.(string))
|
||||
case parse.TABLE:
|
||||
// TODO
|
||||
pieceMdStr = formatTable(piece)
|
||||
case parse.CODE_INLINE:
|
||||
// TODO
|
||||
case parse.CODE_BLOCK:
|
||||
@@ -201,6 +201,15 @@ func formatContent(pieces []parse.Piece, depth int) (string, map[string][]byte)
|
||||
return contentMdStr, saveImageBytes
|
||||
}
|
||||
|
||||
func formatTable(piece parse.Piece) string {
|
||||
var tableMdStr string
|
||||
if piece.Attrs != nil && piece.Attrs["type"] == "native" {
|
||||
tableMdStr = piece.Val.(string)
|
||||
}
|
||||
// TODO
|
||||
return tableMdStr
|
||||
}
|
||||
|
||||
func formatBlockQuote(piece parse.Piece, depth int) (string, map[string][]byte) {
|
||||
var bqMdString string
|
||||
var prefix string = ">"
|
||||
|
||||
Reference in New Issue
Block a user