🐛 Blockquote in list turn into paragraph causes internal error https://github.com/siyuan-note/siyuan/issues/9920

This commit is contained in:
Daniel 2023-12-19 11:38:56 +08:00
parent cf6c6e6375
commit 766454154d
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -137,6 +137,10 @@ func ExportNodeStdMd(node *ast.Node, luteEngine *lute.Lute) string {
}
func IsNodeOCRed(node *ast.Node) (ret bool) {
if !util.TesseractEnabled || nil == node {
return
}
ret = true
ast.Walk(node, func(n *ast.Node, entering bool) ast.WalkStatus {
if !entering {
@ -145,16 +149,18 @@ func IsNodeOCRed(node *ast.Node) (ret bool) {
if ast.NodeImage == n.Type {
linkDest := n.ChildByType(ast.NodeLinkDest)
if nil != linkDest {
linkDestStr := linkDest.TokensStr()
if !cache.ExistAsset(linkDestStr) {
return ast.WalkContinue
}
if nil == linkDest {
return ast.WalkContinue
}
if !util.ExistsAssetText(linkDestStr) {
ret = false
return ast.WalkStop
}
linkDestStr := linkDest.TokensStr()
if !cache.ExistAsset(linkDestStr) {
return ast.WalkContinue
}
if !util.ExistsAssetText(linkDestStr) {
ret = false
return ast.WalkStop
}
}
return ast.WalkContinue