mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 15:10: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{}
|
parentRefParagraphs := map[string]*Block{}
|
||||||
|
var paragraphParentIDs []string
|
||||||
for _, link := range links {
|
for _, link := range links {
|
||||||
for _, ref := range link.Refs {
|
for _, ref := range link.Refs {
|
||||||
if "NodeParagraph" == ref.Type {
|
if "NodeParagraph" == ref.Type {
|
||||||
parentRefParagraphs[ref.ParentID] = ref
|
parentRefParagraphs[ref.ParentID] = ref
|
||||||
|
paragraphParentIDs = append(paragraphParentIDs, ref.ParentID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var paragraphParentIDs []string
|
|
||||||
for parentID := range parentRefParagraphs {
|
|
||||||
paragraphParentIDs = append(paragraphParentIDs, parentID)
|
|
||||||
}
|
|
||||||
sqlParagraphParents := sql.GetBlocks(paragraphParentIDs)
|
sqlParagraphParents := sql.GetBlocks(paragraphParentIDs)
|
||||||
paragraphParents := fromSQLBlocks(&sqlParagraphParents, "", 12)
|
paragraphParents := fromSQLBlocks(&sqlParagraphParents, "", 12)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -567,16 +567,13 @@ func buildBacklinkListItemRefs(refIDs []string) (retRefIDs []string, originalRef
|
||||||
refBlocks := fromSQLBlocks(&sqlRefBlocks, "", 12)
|
refBlocks := fromSQLBlocks(&sqlRefBlocks, "", 12)
|
||||||
|
|
||||||
parentRefParagraphs := map[string]*Block{}
|
parentRefParagraphs := map[string]*Block{}
|
||||||
|
var paragraphParentIDs []string
|
||||||
for _, ref := range refBlocks {
|
for _, ref := range refBlocks {
|
||||||
if nil != ref && "NodeParagraph" == ref.Type {
|
if nil != ref && "NodeParagraph" == ref.Type {
|
||||||
parentRefParagraphs[ref.ParentID] = ref
|
parentRefParagraphs[ref.ParentID] = ref
|
||||||
|
paragraphParentIDs = append(paragraphParentIDs, ref.ParentID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var paragraphParentIDs []string
|
|
||||||
for parentID := range parentRefParagraphs {
|
|
||||||
paragraphParentIDs = append(paragraphParentIDs, parentID)
|
|
||||||
}
|
|
||||||
sqlParagraphParents := sql.GetBlocks(paragraphParentIDs)
|
sqlParagraphParents := sql.GetBlocks(paragraphParentIDs)
|
||||||
paragraphParents := fromSQLBlocks(&sqlParagraphParents, "", 12)
|
paragraphParents := fromSQLBlocks(&sqlParagraphParents, "", 12)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue