mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-21 03:21:21 +08:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
006cb533ac
@ -7,7 +7,7 @@
|
||||
"id": "20240317202444-5txwumu",
|
||||
"title": "Extend development",
|
||||
"type": "doc",
|
||||
"updated": "20240317202840"
|
||||
"updated": "20240407172201"
|
||||
},
|
||||
"Children": [
|
||||
{
|
||||
@ -283,7 +283,7 @@
|
||||
"ListData": {},
|
||||
"Properties": {
|
||||
"id": "20240317202702-wczm3on",
|
||||
"updated": "20240317202840"
|
||||
"updated": "20240407172201"
|
||||
},
|
||||
"Children": [
|
||||
{
|
||||
@ -377,7 +377,7 @@
|
||||
},
|
||||
"Properties": {
|
||||
"id": "20240317202755-i4ttgax",
|
||||
"updated": "20240317202837"
|
||||
"updated": "20240407172201"
|
||||
},
|
||||
"Children": [
|
||||
{
|
||||
@ -399,7 +399,7 @@
|
||||
"Type": "NodeBlockquote",
|
||||
"Properties": {
|
||||
"id": "20240317202837-ahu56j5",
|
||||
"updated": "20240317202837"
|
||||
"updated": "20240407172201"
|
||||
},
|
||||
"Children": [
|
||||
{
|
||||
@ -411,22 +411,12 @@
|
||||
"Type": "NodeParagraph",
|
||||
"Properties": {
|
||||
"id": "20240317202837-83ygog5",
|
||||
"updated": "20240317202837"
|
||||
"updated": "20240407172201"
|
||||
},
|
||||
"Children": [
|
||||
{
|
||||
"Type": "NodeText",
|
||||
"Data": "For more details, please refer to "
|
||||
},
|
||||
{
|
||||
"Type": "NodeTextMark",
|
||||
"TextMarkType": "a",
|
||||
"TextMarkAHref": "https://github.com/siyuan-note/siyuan/issues/9807",
|
||||
"TextMarkTextContent": "Github Issue #9807"
|
||||
},
|
||||
{
|
||||
"Type": "NodeText",
|
||||
"Data": "."
|
||||
"Data": "For more details, please refer to Github Issue #9807."
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
"id": "20240317200013-fim8wm8",
|
||||
"title": "扩展开发",
|
||||
"type": "doc",
|
||||
"updated": "20240317202200"
|
||||
"updated": "20240407172150"
|
||||
},
|
||||
"Children": [
|
||||
{
|
||||
@ -277,7 +277,7 @@
|
||||
"ListData": {},
|
||||
"Properties": {
|
||||
"id": "20240317201708-e6uwpl2",
|
||||
"updated": "20240317202200"
|
||||
"updated": "20240407172150"
|
||||
},
|
||||
"Children": [
|
||||
{
|
||||
@ -362,7 +362,7 @@
|
||||
},
|
||||
"Properties": {
|
||||
"id": "20240317201924-6yrpv38",
|
||||
"updated": "20240317202200"
|
||||
"updated": "20240407172150"
|
||||
},
|
||||
"Children": [
|
||||
{
|
||||
@ -384,7 +384,7 @@
|
||||
"Type": "NodeBlockquote",
|
||||
"Properties": {
|
||||
"id": "20240317201924-ljq7w3h",
|
||||
"updated": "20240317201924"
|
||||
"updated": "20240407172150"
|
||||
},
|
||||
"Children": [
|
||||
{
|
||||
@ -396,22 +396,12 @@
|
||||
"Type": "NodeParagraph",
|
||||
"Properties": {
|
||||
"id": "20240317201924-fr7chfe",
|
||||
"updated": "20240317201924"
|
||||
"updated": "20240407172150"
|
||||
},
|
||||
"Children": [
|
||||
{
|
||||
"Type": "NodeText",
|
||||
"Data": "详情请见 "
|
||||
},
|
||||
{
|
||||
"Type": "NodeTextMark",
|
||||
"TextMarkType": "a",
|
||||
"TextMarkAHref": "https://github.com/siyuan-note/siyuan/issues/9807",
|
||||
"TextMarkTextContent": "Github Issue #9807"
|
||||
},
|
||||
{
|
||||
"Type": "NodeText",
|
||||
"Data": "。"
|
||||
"Data": "详情请见 Github Issue #9807。"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
"id": "20240317202230-l8duv3r",
|
||||
"title": "擴充開發",
|
||||
"type": "doc",
|
||||
"updated": "20240317202429"
|
||||
"updated": "20240407172156"
|
||||
},
|
||||
"Children": [
|
||||
{
|
||||
@ -283,7 +283,7 @@
|
||||
"ListData": {},
|
||||
"Properties": {
|
||||
"id": "20240317202310-3n68u3l",
|
||||
"updated": "20240317202310"
|
||||
"updated": "20240407172156"
|
||||
},
|
||||
"Children": [
|
||||
{
|
||||
@ -368,7 +368,7 @@
|
||||
},
|
||||
"Properties": {
|
||||
"id": "20240317202310-poaxn3m",
|
||||
"updated": "20240317202310"
|
||||
"updated": "20240407172156"
|
||||
},
|
||||
"Children": [
|
||||
{
|
||||
@ -390,7 +390,7 @@
|
||||
"Type": "NodeBlockquote",
|
||||
"Properties": {
|
||||
"id": "20240317202310-ozkltzq",
|
||||
"updated": "20240317202310"
|
||||
"updated": "20240407172156"
|
||||
},
|
||||
"Children": [
|
||||
{
|
||||
@ -402,22 +402,12 @@
|
||||
"Type": "NodeParagraph",
|
||||
"Properties": {
|
||||
"id": "20240317202310-tfo5fiq",
|
||||
"updated": "20240317202310"
|
||||
"updated": "20240407172156"
|
||||
},
|
||||
"Children": [
|
||||
{
|
||||
"Type": "NodeText",
|
||||
"Data": "詳情請見 "
|
||||
},
|
||||
{
|
||||
"Type": "NodeTextMark",
|
||||
"TextMarkType": "a",
|
||||
"TextMarkAHref": "https://github.com/siyuan-note/siyuan/issues/9807",
|
||||
"TextMarkTextContent": "Github Issue #9807"
|
||||
},
|
||||
{
|
||||
"Type": "NodeText",
|
||||
"Data": "。"
|
||||
"Data": "詳情請見 Github Issue #9807。"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -811,35 +811,48 @@ func removeAvBlockRel(node *ast.Node) {
|
||||
}
|
||||
|
||||
func syncDelete2AttributeView(node *ast.Node) {
|
||||
avs := node.IALAttr(av.NodeAttrNameAvs)
|
||||
if "" == avs {
|
||||
return
|
||||
}
|
||||
|
||||
avIDs := strings.Split(avs, ",")
|
||||
for _, avID := range avIDs {
|
||||
attrView, parseErr := av.ParseAttributeView(avID)
|
||||
if nil != parseErr {
|
||||
continue
|
||||
changedAvIDs := hashset.New()
|
||||
ast.Walk(node, func(n *ast.Node, entering bool) ast.WalkStatus {
|
||||
if !entering || !n.IsBlock() {
|
||||
return ast.WalkContinue
|
||||
}
|
||||
|
||||
changedAv := false
|
||||
blockValues := attrView.GetBlockKeyValues()
|
||||
if nil == blockValues {
|
||||
continue
|
||||
avs := n.IALAttr(av.NodeAttrNameAvs)
|
||||
if "" == avs {
|
||||
return ast.WalkContinue
|
||||
}
|
||||
|
||||
for i, blockValue := range blockValues.Values {
|
||||
if blockValue.Block.ID == node.ID {
|
||||
blockValues.Values = append(blockValues.Values[:i], blockValues.Values[i+1:]...)
|
||||
changedAv = true
|
||||
break
|
||||
avIDs := strings.Split(avs, ",")
|
||||
for _, avID := range avIDs {
|
||||
attrView, parseErr := av.ParseAttributeView(avID)
|
||||
if nil != parseErr {
|
||||
continue
|
||||
}
|
||||
|
||||
changedAv := false
|
||||
blockValues := attrView.GetBlockKeyValues()
|
||||
if nil == blockValues {
|
||||
continue
|
||||
}
|
||||
|
||||
for i, blockValue := range blockValues.Values {
|
||||
if blockValue.Block.ID == n.ID {
|
||||
blockValues.Values = append(blockValues.Values[:i], blockValues.Values[i+1:]...)
|
||||
changedAv = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if changedAv {
|
||||
av.SaveAttributeView(attrView)
|
||||
changedAvIDs.Add(avID)
|
||||
}
|
||||
}
|
||||
if changedAv {
|
||||
av.SaveAttributeView(attrView)
|
||||
util.BroadcastByType("protyle", "refreshAttributeView", 0, "", map[string]interface{}{"id": avID})
|
||||
}
|
||||
return ast.WalkContinue
|
||||
})
|
||||
|
||||
for _, avID := range changedAvIDs.Values() {
|
||||
util.BroadcastByType("protyle", "refreshAttributeView", 0, "", map[string]interface{}{"id": avID})
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user