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

This commit is contained in:
Vanessa 2025-10-08 17:58:30 +08:00
commit e2e073b1ed
4 changed files with 8 additions and 23 deletions

File diff suppressed because one or more lines are too long

View file

@ -8,7 +8,7 @@ require (
github.com/88250/epub v0.0.0-20230830085737-c19055cd1f48
github.com/88250/go-humanize v0.0.0-20240424102817-4f78fac47ea7
github.com/88250/gulu v1.2.3-0.20250227144607-7f4570b0d689
github.com/88250/lute v1.7.7-0.20251007105701-24c6f43d8533
github.com/88250/lute v1.7.7-0.20251008091500-69441b957ffe
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1
github.com/ClarkThan/ahocorasick v0.0.0-20231011042242-30d1ef1347f4
github.com/ConradIrwin/font v0.2.1

View file

@ -14,8 +14,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.20250227144607-7f4570b0d689 h1:39y5g7vnFAIcXhTN3IXPk7h2xBhC4a9hBTykDhHJqRY=
github.com/88250/gulu v1.2.3-0.20250227144607-7f4570b0d689/go.mod h1:c8uVw25vW2W4dhJ/j4iYsX5H1hc19spim266jO5x2hU=
github.com/88250/lute v1.7.7-0.20251007105701-24c6f43d8533 h1:d0+W6SWKH8riPRkpoURkfY2MRbiLFuencOlVZi00i+E=
github.com/88250/lute v1.7.7-0.20251007105701-24c6f43d8533/go.mod h1:WYyUw//5yVw9BJnoVjx7rI/3szsISxNZCYGOqTIrV0o=
github.com/88250/lute v1.7.7-0.20251008091500-69441b957ffe h1:0gQlEMC+jobGOMrh/RR4F2NLotfaUiOITOW4iN7OZ+k=
github.com/88250/lute v1.7.7-0.20251008091500-69441b957ffe/go.mod h1:WYyUw//5yVw9BJnoVjx7rI/3szsISxNZCYGOqTIrV0o=
github.com/88250/pdfcpu v0.3.14-0.20250424122812-f10e8d9d8d46 h1:Bq1JsDfVbHKUxNL/B2JXd8cC/1h6aFjrlXpGycnh0Hk=
github.com/88250/pdfcpu v0.3.14-0.20250424122812-f10e8d9d8d46/go.mod h1:fVfOloBzs2+W2VJCCbq60XIxc3yJHAZ0Gahv1oO0gyI=
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 h1:48T899JQDwyyRu9yXHePYlPdHtpJfrJEUGBMH3SMBWY=

View file

@ -2288,24 +2288,9 @@ func exportTree(tree *parse.Tree, wysiwyg, keepFold, avHiddenCol bool,
n.InsertBefore(blockRefLink)
unlinks = append(unlinks, n)
case 3: // 仅锚文本
var blockRefLink *ast.Node
if 0 < len(n.KramdownIAL) {
blockRefLink = &ast.Node{Type: ast.NodeTextMark, TextMarkType: "text", TextMarkTextContent: linkText}
blockRefLink := &ast.Node{Type: ast.NodeTextMark, TextMarkType: strings.TrimSpace(strings.ReplaceAll(n.TextMarkType, "block-ref", "")), TextMarkTextContent: linkText}
blockRefLink.KramdownIAL = n.KramdownIAL
if n.IsTextMarkType("inline-memo") {
blockRefLink.TextMarkInlineMemoContent = n.TextMarkInlineMemoContent
blockRefLink.TextMarkType = "text inline-memo"
}
} else {
blockRefLink = &ast.Node{Type: ast.NodeText, Tokens: []byte(linkText)}
if "block-ref" != n.TextMarkType {
blockRefLink.Type = ast.NodeTextMark
blockRefLink.TextMarkType = strings.TrimSpace(strings.ReplaceAll(n.TextMarkType, "block-ref", ""))
blockRefLink.TextMarkTextContent = linkText
blockRefLink.TextMarkInlineMemoContent = n.TextMarkInlineMemoContent
}
}
n.InsertBefore(blockRefLink)
unlinks = append(unlinks, n)
case 4: // 脚注+锚点哈希
@ -2999,7 +2984,7 @@ func blockLink2Ref0(currentTree *parse.Tree, node *ast.Node, treeCache map[strin
}
if treenode.IsBlockLink(n) {
n.TextMarkType = "block-ref"
n.TextMarkType = strings.TrimSpace(strings.TrimPrefix(n.TextMarkType, "a") + " block-ref")
n.TextMarkBlockRefID = strings.TrimPrefix(n.TextMarkAHref, "siyuan://blocks/")
n.TextMarkBlockRefSubtype = "s"