Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2024-01-15 23:44:39 +08:00
commit ac952ee2bc
4 changed files with 12 additions and 12 deletions

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@ require (
github.com/88250/clipboard v0.1.5
github.com/88250/epub v0.0.0-20230830085737-c19055cd1f48
github.com/88250/gulu v1.2.3-0.20231209020950-b7b6994e395c
github.com/88250/lute v1.7.6-0.20240112115240-51ac39f8bb30
github.com/88250/lute v1.7.6-0.20240115144346-d66c956e0189
github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1
github.com/ClarkThan/ahocorasick v0.0.0-20231011042242-30d1ef1347f4

View File

@ -10,8 +10,8 @@ github.com/88250/go-sqlite3 v1.14.13-0.20231214121541-e7f54c482950 h1:Pa5hMiBceT
github.com/88250/go-sqlite3 v1.14.13-0.20231214121541-e7f54c482950/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/88250/gulu v1.2.3-0.20231209020950-b7b6994e395c h1:Fas3hxqP33xA9KKDV50jUmppiiOukk5bdV00Hk5VSSk=
github.com/88250/gulu v1.2.3-0.20231209020950-b7b6994e395c/go.mod h1:pTWnjt+6qUqNnP9xltswsJxgCBVu3C7eW09u48LWX0k=
github.com/88250/lute v1.7.6-0.20240112115240-51ac39f8bb30 h1:il3u207XuRGQw/Wf0QCzi3sl4Tj7TmnPAgDNLDmmas0=
github.com/88250/lute v1.7.6-0.20240112115240-51ac39f8bb30/go.mod h1:+wUqx/1kdFDbWtxn9LYJlaCOAeol2pjSO6w+WJTVQsg=
github.com/88250/lute v1.7.6-0.20240115144346-d66c956e0189 h1:GVGRSVGaELzKBKEMKoH7n/hfbENtxzFeVf6FEw3sowg=
github.com/88250/lute v1.7.6-0.20240115144346-d66c956e0189/go.mod h1:+wUqx/1kdFDbWtxn9LYJlaCOAeol2pjSO6w+WJTVQsg=
github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c h1:Dl/8S9iLyPMTElnWIBxmjaLiWrkI5P4a21ivwAn5pU0=
github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c/go.mod h1:S5YT38L/GCjVjmB4PB84PymA1qfopjEhfhTNQilLpv4=
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 h1:48T899JQDwyyRu9yXHePYlPdHtpJfrJEUGBMH3SMBWY=

View File

@ -865,11 +865,13 @@ func prepareExportTree(bt *treenode.BlockTree) (ret *parse.Tree) {
}
}
oldRoot := ret.Root
ret = parse.Parse("", []byte(""), luteEngine.ParseOptions)
first := ret.Root.FirstChild
for _, node := range nodes {
first.InsertBefore(node)
}
ret.Root.KramdownIAL = oldRoot.KramdownIAL
}
ret.Path = bt.Path
ret.HPath = bt.HPath
@ -2033,16 +2035,14 @@ func exportTree(tree *parse.Tree, wysiwyg, expandKaTexMacros, keepFold bool,
switch blockRefMode {
case 2: // 锚文本块链
var blockRefLink *ast.Node
blockRefLink = &ast.Node{Type: ast.NodeLink}
blockRefLink.AppendChild(&ast.Node{Type: ast.NodeOpenBracket})
blockRefLink.AppendChild(&ast.Node{Type: ast.NodeLinkText, Tokens: []byte(linkText)})
blockRefLink.AppendChild(&ast.Node{Type: ast.NodeCloseBracket})
blockRefLink.AppendChild(&ast.Node{Type: ast.NodeOpenParen})
blockRefLink.AppendChild(&ast.Node{Type: ast.NodeLinkDest, Tokens: []byte("siyuan://blocks/" + defID)})
blockRefLink.AppendChild(&ast.Node{Type: ast.NodeCloseParen})
blockRefLink = &ast.Node{Type: ast.NodeTextMark, TextMarkType: "a", TextMarkTextContent: linkText, TextMarkAHref: "siyuan://blocks/" + defID}
blockRefLink.KramdownIAL = n.KramdownIAL
n.InsertBefore(blockRefLink)
case 3: // 仅锚文本
n.InsertBefore(&ast.Node{Type: ast.NodeText, Tokens: []byte(linkText)})
var blockRefLink *ast.Node
blockRefLink = &ast.Node{Type: ast.NodeTextMark, TextMarkType: "text", TextMarkTextContent: linkText}
blockRefLink.KramdownIAL = n.KramdownIAL
n.InsertBefore(blockRefLink)
case 4: // 脚注
refFoot := getRefAsFootnotes(defID, &refFootnotes)
n.InsertBefore(&ast.Node{Type: ast.NodeText, Tokens: []byte(linkText)})