🎨 增加挂件块数据导出属性 data-export-html
Fix https://github.com/siyuan-note/siyuan/issues/6188
This commit is contained in:
parent
38012d444a
commit
df5f5272c1
1 changed files with 12 additions and 1 deletions
|
@ -1259,7 +1259,18 @@ func exportTree(tree *parse.Tree, wysiwyg, expandKaTexMacros, keepFold bool) (re
|
|||
}
|
||||
|
||||
if ast.NodeWidget == n.Type {
|
||||
// 挂件块导出 https://github.com/siyuan-note/siyuan/issues/3834
|
||||
// 挂件块导出 https://github.com/siyuan-note/siyuan/issues/3834 https://github.com/siyuan-note/siyuan/issues/6188
|
||||
|
||||
if wysiwyg {
|
||||
exportHtmlVal := n.IALAttr("data-export-html")
|
||||
if "" != exportHtmlVal {
|
||||
htmlBlock := &ast.Node{Type: ast.NodeHTMLBlock, Tokens: []byte(exportHtmlVal)}
|
||||
n.InsertBefore(htmlBlock)
|
||||
unlinks = append(unlinks, n)
|
||||
return ast.WalkContinue
|
||||
}
|
||||
}
|
||||
|
||||
exportMdVal := n.IALAttr("data-export-md")
|
||||
exportMdVal = html.UnescapeString(exportMdVal) // 导出 `data-export-md` 时未解析代码块与行内代码内的转义字符 https://github.com/siyuan-note/siyuan/issues/4180
|
||||
if "" != exportMdVal {
|
||||
|
|
Loading…
Add table
Reference in a new issue