mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
🎨 Revert Improve backlink filtering below the heading Improve backlink filtering below the heading
This commit is contained in:
parent
082e4a9ca9
commit
84e9a003e8
1 changed files with 5 additions and 13 deletions
|
|
@ -476,7 +476,7 @@ func GetBacklink(id, keyword, mentionKeyword string, beforeLen int, containChild
|
|||
var paragraphParentIDs []string
|
||||
for _, link := range links {
|
||||
for _, ref := range link.Refs {
|
||||
if "NodeParagraph" == ref.Type || "NodeHeading" == ref.Type {
|
||||
if "NodeParagraph" == ref.Type {
|
||||
paragraphParentIDs = append(paragraphParentIDs, ref.ParentID)
|
||||
}
|
||||
}
|
||||
|
|
@ -494,7 +494,7 @@ func GetBacklink(id, keyword, mentionKeyword string, beforeLen int, containChild
|
|||
}
|
||||
for _, link := range links {
|
||||
for _, ref := range link.Refs {
|
||||
if "NodeParagraph" == ref.Type || "NodeHeading" == ref.Type {
|
||||
if "NodeParagraph" == ref.Type {
|
||||
if processedParagraphs.Contains(ref.ParentID) {
|
||||
continue
|
||||
}
|
||||
|
|
@ -580,7 +580,7 @@ func buildLinkRefs(defRootID string, refs []*sql.Ref, keywords []string) (ret []
|
|||
var paragraphParentIDs []string
|
||||
for _, link := range links {
|
||||
for _, ref := range link.Refs {
|
||||
if "NodeParagraph" == ref.Type || "NodeHeading" == ref.Type {
|
||||
if "NodeParagraph" == ref.Type {
|
||||
parentRefParagraphs[ref.ParentID] = ref
|
||||
paragraphParentIDs = append(paragraphParentIDs, ref.ParentID)
|
||||
}
|
||||
|
|
@ -615,15 +615,7 @@ func buildLinkRefs(defRootID string, refs []*sql.Ref, keywords []string) (ret []
|
|||
continue
|
||||
}
|
||||
|
||||
text := c.Text()
|
||||
if strings.HasPrefix(text, "#") {
|
||||
tmp := strings.ReplaceAll(text, "#", "")
|
||||
if " " == tmp { // 如果是标题标记符则跳过
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
if "" != strings.TrimSpace(text) {
|
||||
if "" != strings.TrimSpace(c.Text()) {
|
||||
paragraphUseParentLi = false
|
||||
break
|
||||
}
|
||||
|
|
@ -648,7 +640,7 @@ func buildLinkRefs(defRootID string, refs []*sql.Ref, keywords []string) (ret []
|
|||
}
|
||||
for _, link := range links {
|
||||
for _, ref := range link.Refs {
|
||||
if "NodeParagraph" == ref.Type || "NodeHeading" == ref.Type {
|
||||
if "NodeParagraph" == ref.Type {
|
||||
if processedParagraphs.Contains(ref.ParentID) {
|
||||
continue
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue