Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

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

Daniel766454154d0d
diff --git a/kernel/treenode/node.go b/kernel/treenode/node.go
index eaf962dcf0..691717d529 100644
--- a/kernel/treenode/node.go
+++ b/kernel/treenode/node.go
@@ -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