mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-21 11:30:42 +08:00
🐛 导入 Markdown 时转换 Base64 图片失效 Fix https://github.com/siyuan-note/siyuan/issues/6909
This commit is contained in:
parent
f0c996b752
commit
2b451eddad
@ -452,7 +452,6 @@ func moveTree(tree *parse.Tree) {
|
||||
|
||||
func parseStdMd(markdown []byte) (ret *parse.Tree) {
|
||||
luteEngine := lute.New()
|
||||
luteEngine.SetProtyleWYSIWYG(true)
|
||||
luteEngine.SetFootnotes(false)
|
||||
luteEngine.SetToC(false)
|
||||
luteEngine.SetIndentCodeBlock(false)
|
||||
@ -510,6 +509,14 @@ func genTreeID(tree *parse.Tree) {
|
||||
if "" == n.ID && 0 < len(n.KramdownIAL) && ast.NodeDocument != n.Type {
|
||||
n.ID = n.IALAttr("id")
|
||||
}
|
||||
|
||||
if ast.NodeParagraph == n.Type && nil != n.FirstChild && ast.NodeTaskListItemMarker == n.FirstChild.Type {
|
||||
// 踢掉任务列表的第一个子节点左侧空格
|
||||
n.FirstChild.Next.Tokens = bytes.TrimLeft(n.FirstChild.Next.Tokens, " ")
|
||||
// 调整 li.p.tlim 为 li.tlim.p
|
||||
n.InsertBefore(n.FirstChild)
|
||||
}
|
||||
|
||||
return ast.WalkContinue
|
||||
})
|
||||
tree.Root.KramdownIAL = parse.Tokens2IAL(tree.Root.LastChild.Tokens)
|
||||
|
Loading…
Reference in New Issue
Block a user