feat: 文章中的图片转成base64存在生成的markdown里

This commit is contained in:
fengxxc
2022-10-23 00:52:11 +08:00
parent cf2b343af0
commit ef6d319545
2 changed files with 26 additions and 2 deletions

View File

@@ -122,7 +122,8 @@ func formatCodeBlock(piece parse.Piece) string {
}
func formatImage(piece parse.Piece) string {
return "![" + piece.Attrs["alt"] + "](" + piece.Attrs["src"] + " \"" + piece.Attrs["title"] + "\")"
// return "![" + piece.Attrs["alt"] + "](" + piece.Attrs["src"] + " \"" + piece.Attrs["title"] + "\")"
return "![" + piece.Attrs["alt"] + "](data:image/png;base64," + piece.Val.(string) + ")"
}
func formatLink(piece parse.Piece) string {