mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 Repeat the escaped content of the image title https://github.com/siyuan-note/siyuan/issues/11681
This commit is contained in:
parent
519b004f81
commit
334f693d5d
4 changed files with 11 additions and 6 deletions
|
|
@ -429,11 +429,11 @@ func (box *Box) moveTrees0(files []*FileInfo) {
|
|||
func parseKTree(kramdown []byte) (ret *parse.Tree) {
|
||||
luteEngine := NewLute()
|
||||
ret = parse.Parse("", kramdown, luteEngine.ParseOptions)
|
||||
genTreeID(ret)
|
||||
normalizeTree(ret)
|
||||
return
|
||||
}
|
||||
|
||||
func genTreeID(tree *parse.Tree) {
|
||||
func normalizeTree(tree *parse.Tree) {
|
||||
if nil == tree.Root.FirstChild {
|
||||
tree.Root.AppendChild(treenode.NewParagraph())
|
||||
}
|
||||
|
|
@ -494,6 +494,11 @@ func genTreeID(tree *parse.Tree) {
|
|||
n.InsertBefore(n.FirstChild)
|
||||
}
|
||||
|
||||
if ast.NodeLinkTitle == n.Type {
|
||||
// 避免重复转义图片标题内容 Repeat the escaped content of the image title https://github.com/siyuan-note/siyuan/issues/11681
|
||||
n.Tokens = html.UnescapeBytes(n.Tokens)
|
||||
}
|
||||
|
||||
return ast.WalkContinue
|
||||
})
|
||||
tree.Root.KramdownIAL = parse.Tokens2IAL(tree.Root.LastChild.Tokens)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue