diff --git a/app/appearance/langs/de_DE.json b/app/appearance/langs/de_DE.json
index 67b24984d..1eddcfb06 100644
--- a/app/appearance/langs/de_DE.json
+++ b/app/appearance/langs/de_DE.json
@@ -1,4 +1,6 @@
{
+ "backlinkContainChildren": "Enthalten Rückverweise untergeordnete Blöcke",
+ "backlinkContainChildrenTip": "Wenn aktiviert, werden untergeordnete Blöcke in die Berechnung der Rückverweise einbezogen",
"entryNum": "Anzahl der Einträge",
"workspaceData": "Arbeitsbereichsdaten",
"confirmRemoveRelationField": "Sind Sie sicher, dass Sie das Feld, das mit ${x} verknüpft ist, löschen möchten?",
diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.json
index 58608e0fb..570217c9f 100644
--- a/app/appearance/langs/en_US.json
+++ b/app/appearance/langs/en_US.json
@@ -1,4 +1,6 @@
{
+ "backlinkContainChildren": "Do backlinks contain child blocks",
+ "backlinkContainChildrenTip": "When enabled, child blocks will be included in the backlink calculation",
"entryNum": "Number of entries",
"workspaceData": "Workspace data",
"confirmRemoveRelationField": "Are you sure you want to delete the field associated with ${x}?",
diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.json
index e7d7b939d..426978c5e 100644
--- a/app/appearance/langs/es_ES.json
+++ b/app/appearance/langs/es_ES.json
@@ -1,4 +1,6 @@
{
+ "backlinkContainChildren": "¿Los enlaces inversos contienen bloques secundarios?",
+ "backlinkContainChildrenTip": "Una vez habilitado, los bloques secundarios se incluirán en el cálculo de los enlaces inversos",
"entryNum": "Número de entradas",
"workspaceData": "Datos del espacio de trabajo",
"confirmRemoveRelationField": "¿Está seguro de que desea eliminar el campo asociado a ${x}?",
diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.json
index e4aff93eb..c45c36891 100644
--- a/app/appearance/langs/fr_FR.json
+++ b/app/appearance/langs/fr_FR.json
@@ -1,4 +1,6 @@
{
+ "backlinkContainChildren": "Les liens retour contiennent-ils des sous-blocs",
+ "backlinkContainChildrenTip": "Une fois activé, les sous-blocs seront inclus dans le calcul des liens retour",
"entryNum": "Nombre d'entrées",
"workspaceData": "Données de l'espace de travail",
"confirmRemoveRelationField": "Êtes-vous sûr de vouloir supprimer le champ associé à ${x}?",
diff --git a/app/appearance/langs/he_IL.json b/app/appearance/langs/he_IL.json
index 5aac13d94..b5e218ff5 100644
--- a/app/appearance/langs/he_IL.json
+++ b/app/appearance/langs/he_IL.json
@@ -1,4 +1,6 @@
{
+ "backlinkContainChildren": "האם קישורים חוזרים כוללים בלוקים משניים",
+ "backlinkContainChildrenTip": "לאחר ההפעלה, בלוקים משניים ייכללו בחישוב הקישורים החוזרים",
"entryNum": "מספר ערכים",
"workspaceData": "נתוני סביבת עבודה",
"confirmRemoveRelationField": "האם אתה בטוח שברצונך למחוק את השדה המשויך ל-${x}?",
diff --git a/app/appearance/langs/it_IT.json b/app/appearance/langs/it_IT.json
index efbc4bfd7..b841cf6c9 100644
--- a/app/appearance/langs/it_IT.json
+++ b/app/appearance/langs/it_IT.json
@@ -1,4 +1,6 @@
{
+ "backlinkContainChildren": "I backlink contengono blocchi figli",
+ "backlinkContainChildrenTip": "Dopo l'attivazione, i blocchi figli saranno inclusi nel calcolo dei backlink",
"entryNum": "Numero di voci",
"workspaceData": "Dati dello spazio di lavoro",
"confirmRemoveRelationField": "Sei sicuro di voler eliminare il campo associato a ${x}?",
diff --git a/app/appearance/langs/ja_JP.json b/app/appearance/langs/ja_JP.json
index 35bea10f4..9f4ea7767 100644
--- a/app/appearance/langs/ja_JP.json
+++ b/app/appearance/langs/ja_JP.json
@@ -1,4 +1,6 @@
{
+ "backlinkContainChildren": "バックリンクに子ブロックを含めるかどうか",
+ "backlinkContainChildrenTip": "有効にすると、子ブロックがバックリンク計算に含まれます",
"entryNum": "エントリ数",
"workspaceData": "ワークスペースデータ",
"confirmRemoveRelationField": "${x} に関連するフィールドを同時に削除してもよろしいですか?",
diff --git a/app/appearance/langs/pl_PL.json b/app/appearance/langs/pl_PL.json
index b9689c6b1..23213ee0b 100644
--- a/app/appearance/langs/pl_PL.json
+++ b/app/appearance/langs/pl_PL.json
@@ -1,4 +1,6 @@
{
+ "backlinkContainChildren": "Czy linki zwrotne zawierają bloki podrzędne",
+ "backlinkContainChildrenTip": "Po włączeniu bloki podrzędne zostaną uwzględnione w obliczeniach linków zwrotnych",
"entryNum": "Количество записей",
"workspaceData": "Dane przestrzeni roboczej",
"confirmRemoveRelationField": "Czy na pewno chcesz usunąć pole powiązane z ${x}?",
diff --git a/app/appearance/langs/ru_RU.json b/app/appearance/langs/ru_RU.json
index d36786f7f..82e62035d 100644
--- a/app/appearance/langs/ru_RU.json
+++ b/app/appearance/langs/ru_RU.json
@@ -1,4 +1,6 @@
{
+ "backlinkContainChildren": "Включать ли дочерние блоки в обратные ссылки",
+ "backlinkContainChildrenTip": "После включения дочерние блоки будут включены в расчет обратных ссылок",
"entryNum": "Количество записей",
"workspaceData": "Данные рабочей области",
"confirmRemoveRelationField": "Вы уверены, что хотите удалить поле, связанное с ${x}?",
diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.json
index 33697abd5..041315fe7 100644
--- a/app/appearance/langs/zh_CHT.json
+++ b/app/appearance/langs/zh_CHT.json
@@ -1,4 +1,6 @@
{
+ "backlinkContainChildren": "反向鏈接包含子塊",
+ "backlinkContainChildrenTip": "啟用後子塊將被納入到反向鏈接計算中",
"entryNum": "條目數",
"workspaceData": "工作空間數據",
"confirmRemoveRelationField": "確定同時刪除關聯至 ${x} 中的字段嗎?",
diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.json
index c5c400350..d8884343f 100644
--- a/app/appearance/langs/zh_CN.json
+++ b/app/appearance/langs/zh_CN.json
@@ -1,4 +1,6 @@
{
+ "backlinkContainChildren": "反向链接包含子块",
+ "backlinkContainChildrenTip": "启用后子块将被纳入到反向链接计算中",
"entryNum": "条目数",
"workspaceData": "工作空间数据",
"confirmRemoveRelationField": "确定同时删除关联至 ${x} 中的字段吗?",
diff --git a/app/src/config/editor.ts b/app/src/config/editor.ts
index 5c526f81e..7208d34e1 100644
--- a/app/src/config/editor.ts
+++ b/app/src/config/editor.ts
@@ -191,6 +191,14 @@ export const editor = {
+
${window.siyuan.languages.generateHistory}
@@ -386,6 +394,7 @@ export const editor = {
blockRefDynamicAnchorTextMaxLen: parseInt((editor.element.querySelector("#blockRefDynamicAnchorTextMaxLen") as HTMLInputElement).value),
backlinkExpandCount: parseInt((editor.element.querySelector("#backlinkExpandCount") as HTMLInputElement).value),
backmentionExpandCount: parseInt((editor.element.querySelector("#backmentionExpandCount") as HTMLInputElement).value),
+ backlinkContainChildren: (editor.element.querySelector("#backlinkContainChildren") as HTMLInputElement).checked,
dynamicLoadBlocks: dynamicLoadBlocks,
codeLigatures: (editor.element.querySelector("#codeLigatures") as HTMLInputElement).checked,
codeTabSpaces: parseInt((editor.element.querySelector("#codeTabSpaces") as HTMLInputElement).value),
diff --git a/app/src/config/search.ts b/app/src/config/search.ts
index 8d3ffd658..23e894875 100644
--- a/app/src/config/search.ts
+++ b/app/src/config/search.ts
@@ -24,8 +24,9 @@ export const initConfigSearch = (element: HTMLElement, app: App) => {
"onlySearchForDoc", "onlySearchForDocTip", "dynamicLoadBlocks", "dynamicLoadBlocksTip", "fontSizeScrollZoom", "fontSizeScrollZoomTip",
"listItemDotNumberClickFocus", "listItemDotNumberClickFocusTip", "editorMarkdownInlineAsterisk", "editorMarkdownInlineUnderscore",
"editorMarkdownInlineSup", "editorMarkdownInlineSupTip", "editorMarkdownInlineSub", "editorMarkdownInlineSubTip",
- "editorMarkdownInlineTag", "editorMarkdownInlineTagTip", "editorMarkdownInlineMath", "editorMarkdownInlineMathTip",
- "allowHTMLBLockScript", "allowHTMLBLockScriptTip",
+ "editorMarkdownInlineTag", "editorMarkdownInlineTagTip", "editorMarkdownInlineMath", "editorMarkdownInlineMathTip", "editorMarkdownInlineStrikethrough", "editorMarkdownInlineStrikethroughTip",
+ "allowHTMLBLockScript", "allowHTMLBLockScriptTip", "backlinkExpandCount", "backlinkExpandTip", "backmentionExpandCount", "backmentionExpandTip",
+ "backlinkContainChildren", "backlinkContainChildrenTip"
]),
// 文档树
diff --git a/app/src/layout/dock/Backlink.ts b/app/src/layout/dock/Backlink.ts
index 9590fccf1..08f316b7f 100644
--- a/app/src/layout/dock/Backlink.ts
+++ b/app/src/layout/dock/Backlink.ts
@@ -437,7 +437,6 @@ export class Backlink extends Model {
defID: this.blockId,
refTreeID: docId,
keyword: isMention ? this.inputsElement[1].value : this.inputsElement[0].value,
- containChildren: false
}, (response) => {
svgElement.removeAttribute("disabled");
svgElement.classList.add("b3-list-item__arrow--open");
diff --git a/app/src/mobile/settings/editor.ts b/app/src/mobile/settings/editor.ts
index 1db63aa33..32e56c654 100644
--- a/app/src/mobile/settings/editor.ts
+++ b/app/src/mobile/settings/editor.ts
@@ -45,6 +45,7 @@ const setEditor = (modelMainElement: Element) => {
window.siyuan.config.editor.blockRefDynamicAnchorTextMaxLen = parseInt((modelMainElement.querySelector("#blockRefDynamicAnchorTextMaxLen") as HTMLInputElement).value);
window.siyuan.config.editor.backlinkExpandCount = parseInt((modelMainElement.querySelector("#backlinkExpandCount") as HTMLInputElement).value);
window.siyuan.config.editor.backmentionExpandCount = parseInt((modelMainElement.querySelector("#backmentionExpandCount") as HTMLInputElement).value);
+ window.siyuan.config.editor.backlinkContainChildren = (modelMainElement.querySelector("#backlinkContainChildren") as HTMLInputElement).checked;
window.siyuan.config.editor.codeLigatures = (modelMainElement.querySelector("#codeLigatures") as HTMLInputElement).checked;
window.siyuan.config.editor.codeTabSpaces = parseInt((modelMainElement.querySelector("#codeTabSpaces") as HTMLInputElement).value);
window.siyuan.config.editor.fontSize = parseInt((modelMainElement.querySelector("#fontSize") as HTMLInputElement).value);
@@ -220,6 +221,14 @@ export const initEditor = () => {
${window.siyuan.languages.backmentionExpandTip}
+
${window.siyuan.languages.generateHistory}
diff --git a/app/src/protyle/util/reload.ts b/app/src/protyle/util/reload.ts
index 47b699a61..b39fd91a4 100644
--- a/app/src/protyle/util/reload.ts
+++ b/app/src/protyle/util/reload.ts
@@ -44,7 +44,6 @@ export const reloadProtyle = (protyle: IProtyle, focus: boolean, updateReadonly?
defID: protyle.element.getAttribute("data-defid"),
refTreeID: protyle.block.rootID,
keyword: isMention ? inputsElement[1].value : inputsElement[0].value,
- containChildren: false
}, response => {
protyle.options.backlinkData = isMention ? response.data.backmentions : response.data.backlinks;
renderBacklink(protyle, protyle.options.backlinkData);
diff --git a/app/src/types/config.d.ts b/app/src/types/config.d.ts
index 14c34d48b..9bebba93f 100644
--- a/app/src/types/config.d.ts
+++ b/app/src/types/config.d.ts
@@ -341,6 +341,10 @@ declare namespace Config {
* The default number of backlinks to mention
*/
backmentionExpandCount: number;
+ /**
+ * Whether the backlink contains children
+ */
+ backlinkContainChildren: boolean;
/**
* The maximum length of the dynamic anchor text for block references
*/
diff --git a/kernel/api/ref.go b/kernel/api/ref.go
index 24939b7e9..a912ce561 100644
--- a/kernel/api/ref.go
+++ b/kernel/api/ref.go
@@ -51,7 +51,7 @@ func getBackmentionDoc(c *gin.Context) {
defID := arg["defID"].(string)
refTreeID := arg["refTreeID"].(string)
keyword := arg["keyword"].(string)
- containChildren := false
+ containChildren := model.Conf.Editor.BacklinkContainChildren
if val, ok := arg["containChildren"]; ok {
containChildren = val.(bool)
}
@@ -73,7 +73,7 @@ func getBacklinkDoc(c *gin.Context) {
defID := arg["defID"].(string)
refTreeID := arg["refTreeID"].(string)
keyword := arg["keyword"].(string)
- containChildren := false
+ containChildren := model.Conf.Editor.BacklinkContainChildren
if val, ok := arg["containChildren"]; ok {
containChildren = val.(bool)
}
@@ -109,7 +109,7 @@ func getBacklink2(c *gin.Context) {
if nil != mentionSortArg {
mentionSort, _ = strconv.Atoi(mentionSortArg.(string))
}
- containChildren := false
+ containChildren := model.Conf.Editor.BacklinkContainChildren
if val, ok := arg["containChildren"]; ok {
containChildren = val.(bool)
}
@@ -145,7 +145,7 @@ func getBacklink(c *gin.Context) {
if nil != arg["beforeLen"] {
beforeLen = int(arg["beforeLen"].(float64))
}
- containChildren := false
+ containChildren := model.Conf.Editor.BacklinkContainChildren
if val, ok := arg["containChildren"]; ok {
containChildren = val.(bool)
}
diff --git a/kernel/conf/editor.go b/kernel/conf/editor.go
index 71a567966..607a0e912 100644
--- a/kernel/conf/editor.go
+++ b/kernel/conf/editor.go
@@ -51,6 +51,7 @@ type Editor struct {
OnlySearchForDoc bool `json:"onlySearchForDoc"` // 是否启用 [[ 仅搜索文档块
BacklinkExpandCount int `json:"backlinkExpandCount"` // 反向链接默认展开数量
BackmentionExpandCount int `json:"backmentionExpandCount"` // 反链提及默认展开数量
+ BacklinkContainChildren bool `json:"backlinkContainChildren"` // 反向链接是否包含子块进行计算
Markdown *util.Markdown `json:"markdown"` // Markdown 配置
}
@@ -86,6 +87,7 @@ func NewEditor() *Editor {
RTL: false,
BacklinkExpandCount: 8,
BackmentionExpandCount: -1,
+ BacklinkContainChildren: false,
Markdown: util.MarkdownSettings,
}
}