mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
🎨 Improve list item, super block and blockquote backlink propagation https://github.com/siyuan-note/siyuan/issues/13776
This commit is contained in:
parent
d0d5193358
commit
878249a46c
2 changed files with 4 additions and 10 deletions
|
|
@ -573,18 +573,15 @@ func buildLinkRefs(defRootID string, refs []*sql.Ref, keywords []string) (ret []
|
|||
}
|
||||
|
||||
parentRefParagraphs := map[string]*Block{}
|
||||
var paragraphParentIDs []string
|
||||
for _, link := range links {
|
||||
for _, ref := range link.Refs {
|
||||
if "NodeParagraph" == ref.Type {
|
||||
parentRefParagraphs[ref.ParentID] = ref
|
||||
paragraphParentIDs = append(paragraphParentIDs, ref.ParentID)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var paragraphParentIDs []string
|
||||
for parentID := range parentRefParagraphs {
|
||||
paragraphParentIDs = append(paragraphParentIDs, parentID)
|
||||
}
|
||||
sqlParagraphParents := sql.GetBlocks(paragraphParentIDs)
|
||||
paragraphParents := fromSQLBlocks(&sqlParagraphParents, "", 12)
|
||||
|
||||
|
|
|
|||
|
|
@ -567,16 +567,13 @@ func buildBacklinkListItemRefs(refIDs []string) (retRefIDs []string, originalRef
|
|||
refBlocks := fromSQLBlocks(&sqlRefBlocks, "", 12)
|
||||
|
||||
parentRefParagraphs := map[string]*Block{}
|
||||
var paragraphParentIDs []string
|
||||
for _, ref := range refBlocks {
|
||||
if nil != ref && "NodeParagraph" == ref.Type {
|
||||
parentRefParagraphs[ref.ParentID] = ref
|
||||
paragraphParentIDs = append(paragraphParentIDs, ref.ParentID)
|
||||
}
|
||||
}
|
||||
|
||||
var paragraphParentIDs []string
|
||||
for parentID := range parentRefParagraphs {
|
||||
paragraphParentIDs = append(paragraphParentIDs, parentID)
|
||||
}
|
||||
sqlParagraphParents := sql.GetBlocks(paragraphParentIDs)
|
||||
paragraphParents := fromSQLBlocks(&sqlParagraphParents, "", 12)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue