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

This commit is contained in:
Vanessa 2023-02-10 15:30:57 +08:00
commit eb597e719d
3 changed files with 7 additions and 9 deletions

View file

@ -1362,7 +1362,7 @@ func exportTree(tree *parse.Tree, wysiwyg, expandKaTexMacros, keepFold bool,
if n.IsTextMarkType("inline-math") {
n.TextMarkInlineMathContent = strings.TrimSpace(n.TextMarkInlineMathContent)
return ast.WalkContinue
} else if n.IsTextMarkType("file-annotation-ref") {
} else if treenode.IsFileAnnotationRef(n) {
refID := n.TextMarkFileAnnotationRefID
status := processFileAnnotationRef(refID, n, fileAnnotationRefMode)
unlinks = append(unlinks, n)

View file

@ -172,10 +172,8 @@ func IndexRefs() {
return ast.WalkContinue
}
if n.IsTextMarkType("block-ref") {
defBlockIDs = append(defBlockIDs, n.TextMarkBlockRefID)
} else if n.IsTextMarkType("file-annotation-ref") {
defBlockIDs = append(defBlockIDs, n.TextMarkFileAnnotationRefID)
if treenode.IsBlockRef(n) || treenode.IsFileAnnotationRef(n) {
defBlockIDs = append(defBlockIDs, tree.Root.ID)
}
return ast.WalkContinue
})

View file

@ -943,19 +943,19 @@ func markReplaceSpan(n *ast.Node, unlinks *[]*ast.Node, keywords []string, markS
c.TextMarkTextContent = string(c.Tokens)
if n.IsTextMarkType("a") {
c.TextMarkAHref, c.TextMarkATitle = n.TextMarkAHref, n.TextMarkATitle
} else if n.IsTextMarkType("block-ref") {
} else if treenode.IsBlockRef(n) {
c.TextMarkBlockRefID = n.TextMarkBlockRefID
c.TextMarkBlockRefSubtype = n.TextMarkBlockRefSubtype
} else if n.IsTextMarkType("file-annotation-ref") {
} else if treenode.IsFileAnnotationRef(n) {
c.TextMarkFileAnnotationRefID = n.TextMarkFileAnnotationRefID
}
} else if ast.NodeTextMark == c.Type {
if n.IsTextMarkType("a") {
c.TextMarkAHref, c.TextMarkATitle = n.TextMarkAHref, n.TextMarkATitle
} else if n.IsTextMarkType("block-ref") {
} else if treenode.IsBlockRef(n) {
c.TextMarkBlockRefID = n.TextMarkBlockRefID
c.TextMarkBlockRefSubtype = n.TextMarkBlockRefSubtype
} else if n.IsTextMarkType("file-annotation-ref") {
} else if treenode.IsFileAnnotationRef(n) {
c.TextMarkFileAnnotationRefID = n.TextMarkFileAnnotationRefID
}
}