🎨 数据库中表 blocksmarkdown 字段使用 Markdown 标记符 Fix https://github.com/siyuan-note/insider/issues/1053

This commit is contained in:
Liang Ding 2022-09-19 09:48:25 +08:00
parent 371062efdb
commit a383f8de68
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
7 changed files with 21 additions and 10 deletions

View file

@ -168,7 +168,7 @@ func processNestedNode(n *ast.Node, tag string, tags *[]string, unlinks *[]*ast.
}
func NodeStaticMdContent(node *ast.Node, luteEngine *lute.Lute) (md, content string) {
md = FormatNode(node, luteEngine)
md = ExportNodeStdMd(node, luteEngine)
content = NodeStaticContent(node)
return
}
@ -182,6 +182,15 @@ func FormatNode(node *ast.Node, luteEngine *lute.Lute) string {
return markdown
}
func ExportNodeStdMd(node *ast.Node, luteEngine *lute.Lute) string {
markdown, err := lute.ProtyleExportMdNodeSync(node, luteEngine.ParseOptions, luteEngine.RenderOptions)
if nil != err {
root := TreeRoot(node)
logging.LogFatalf("export markdown for node [%s] in tree [%s] failed: %s", node.ID, root.ID, err)
}
return markdown
}
func NodeStaticContent(node *ast.Node) string {
if nil == node {
return ""