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

This commit is contained in:
Vanessa 2025-10-08 16:08:25 +08:00
commit 10690ba3f7
3 changed files with 6 additions and 9 deletions

View file

@ -77,7 +77,10 @@ func getAttributeViewAddingBlockDefaultValues(c *gin.Context) {
} }
avID := arg["avID"].(string) avID := arg["avID"].(string)
viewID := arg["viewID"].(string) var viewID string
if viewIDArg := arg["viewID"]; nil != viewIDArg {
viewID = viewIDArg.(string)
}
var groupID string var groupID string
if groupIDArg := arg["groupID"]; nil != groupIDArg { if groupIDArg := arg["groupID"]; nil != groupIDArg {
groupID = groupIDArg.(string) groupID = groupIDArg.(string)

View file

@ -95,7 +95,7 @@ func GetAttrViewAddingBlockDefaultValues(avID, viewID, groupID, previousBlockID,
return return
} }
view := attrView.GetView(viewID) view, _ := attrView.GetCurrentView(viewID)
if nil == view { if nil == view {
logging.LogErrorf("view [%s] not found in attribute view [%s]", viewID, avID) logging.LogErrorf("view [%s] not found in attribute view [%s]", viewID, avID)
return return

View file

@ -2283,8 +2283,7 @@ func exportTree(tree *parse.Tree, wysiwyg, keepFold, avHiddenCol bool,
case 2: // 锚文本块链 case 2: // 锚文本块链
blockRefLink := &ast.Node{Type: ast.NodeTextMark, TextMarkTextContent: linkText, TextMarkAHref: "siyuan://blocks/" + defID} blockRefLink := &ast.Node{Type: ast.NodeTextMark, TextMarkTextContent: linkText, TextMarkAHref: "siyuan://blocks/" + defID}
blockRefLink.KramdownIAL = n.KramdownIAL blockRefLink.KramdownIAL = n.KramdownIAL
// 除了块引还有其他元素 https://github.com/siyuan-note/siyuan/issues/15698 blockRefLink.TextMarkType = "a " + n.TextMarkType
blockRefLink.TextMarkType = strings.TrimSpace(strings.ReplaceAll(n.TextMarkType, "block-ref", "a"))
blockRefLink.TextMarkInlineMemoContent = n.TextMarkInlineMemoContent blockRefLink.TextMarkInlineMemoContent = n.TextMarkInlineMemoContent
n.InsertBefore(blockRefLink) n.InsertBefore(blockRefLink)
unlinks = append(unlinks, n) unlinks = append(unlinks, n)
@ -2334,11 +2333,6 @@ func exportTree(tree *parse.Tree, wysiwyg, keepFold, avHiddenCol bool,
n.InsertBefore(&ast.Node{Type: ast.NodeFootnotesRef, Tokens: []byte("^" + refFoot.refNum), FootnotesRefId: refFoot.refNum, FootnotesRefLabel: []byte("^" + refFoot.refNum)}) n.InsertBefore(&ast.Node{Type: ast.NodeFootnotesRef, Tokens: []byte("^" + refFoot.refNum), FootnotesRefId: refFoot.refNum, FootnotesRefLabel: []byte("^" + refFoot.refNum)})
unlinks = append(unlinks, n) unlinks = append(unlinks, n)
} }
if nil != n.Next && ast.NodeKramdownSpanIAL == n.Next.Type {
// 引用加排版标记(比如颜色)重叠时丢弃后面的排版属性节点
unlinks = append(unlinks, n.Next)
}
return ast.WalkSkipChildren return ast.WalkSkipChildren
}) })
for _, n := range unlinks { for _, n := range unlinks {