فهرست منبع

:art: The heading block convert doc block to preserve symbols as much as possible https://github.com/siyuan-note/siyuan/issues/11126

Daniel 1 سال پیش
والد
کامیت
d432982f15

+ 2 - 1
app/appearance/langs/en_US.json

@@ -1479,6 +1479,7 @@
     "242": "The binding block already exists in the current database",
     "242": "The binding block already exists in the current database",
     "243": "Only list the first [%d] tags (including subtags), if you need to adjust, please modify [Settings - Doc Tree - Maximum number to list]",
     "243": "Only list the first [%d] tags (including subtags), if you need to adjust, please modify [Settings - Doc Tree - Maximum number to list]",
     "244": "It did not exit normally after the last use. It is recommended to execute [Doc Tree - Rebuild Index]",
     "244": "It did not exit normally after the last use. It is recommended to execute [Doc Tree - Rebuild Index]",
-    "245": "It did not exit normally after the last use. It is recommended to execute [Doc Tree - Rebuild Index]. To exit normally, you need to use [Exit Application] in the right panel"
+    "245": "It did not exit normally after the last use. It is recommended to execute [Doc Tree - Rebuild Index]. To exit normally, you need to use [Exit Application] in the right panel",
+    "246": "The document title cannot contain / and has been replaced with _"
   }
   }
 }
 }

+ 2 - 1
app/appearance/langs/es_ES.json

@@ -1479,6 +1479,7 @@
     "242": "El bloque de enlace ya existe en la base de datos actual",
     "242": "El bloque de enlace ya existe en la base de datos actual",
     "243": "Enumere solo las primeras [%d] etiquetas (incluidas las subetiquetas), modifique [Configuración - Árbol de documentos - Número máximo a listar]",
     "243": "Enumere solo las primeras [%d] etiquetas (incluidas las subetiquetas), modifique [Configuración - Árbol de documentos - Número máximo a listar]",
     "244": "No salió normalmente después del último uso. Se recomienda ejecutar [Árbol de documentos - Reconstruir índice]",
     "244": "No salió normalmente después del último uso. Se recomienda ejecutar [Árbol de documentos - Reconstruir índice]",
-    "245": "No salió normalmente después del último uso. Se recomienda ejecutar [Árbol de documentos - Reconstruir índice]. Para salir normalmente, necesita usar [Salir de la aplicación] en el panel derecho"
+    "245": "No salió normalmente después del último uso. Se recomienda ejecutar [Árbol de documentos - Reconstruir índice]. Para salir normalmente, necesita usar [Salir de la aplicación] en el panel derecho",
+    "246": "El título del documento no puede contener / y ha sido reemplazado por _"
   }
   }
 }
 }

+ 2 - 1
app/appearance/langs/fr_FR.json

@@ -1479,6 +1479,7 @@
     "242": "Le bloc de liaison existe déjà dans la base de données actuelle",
     "242": "Le bloc de liaison existe déjà dans la base de données actuelle",
     "243": "Répertorier uniquement les [%d] premières balises (y compris les sous-balises). veuillez modifier [Paramètres - Arbre des documents - Nombre maximum de documents à lister].",
     "243": "Répertorier uniquement les [%d] premières balises (y compris les sous-balises). veuillez modifier [Paramètres - Arbre des documents - Nombre maximum de documents à lister].",
     "244": "Il ne s'est pas terminé normalement après la dernière utilisation. Il est recommandé d'exécuter [Doc Tree - Rebuild Index]",
     "244": "Il ne s'est pas terminé normalement après la dernière utilisation. Il est recommandé d'exécuter [Doc Tree - Rebuild Index]",
-    "245": "Il ne s'est pas terminé normalement après la dernière utilisation. Il est recommandé d'exécuter [Doc Tree - Rebuild Index]. Pour quitter normalement, vous devez utiliser [Quitter l'application] dans le panneau de droite"
+    "245": "Il ne s'est pas terminé normalement après la dernière utilisation. Il est recommandé d'exécuter [Doc Tree - Rebuild Index]. Pour quitter normalement, vous devez utiliser [Quitter l'application] dans le panneau de droite",
+    "246": "Le titre du document ne peut pas contenir / et a été remplacé par _"
   }
   }
 }
 }

+ 2 - 1
app/appearance/langs/zh_CHT.json

@@ -1479,6 +1479,7 @@
     "242": "目前資料庫中已經存在該綁定區塊",
     "242": "目前資料庫中已經存在該綁定區塊",
     "243": "僅列出前 [%d] 個標籤(含子標籤),如需調整請修改 [設置 - 文檔樹 - 最大列出數量]",
     "243": "僅列出前 [%d] 個標籤(含子標籤),如需調整請修改 [設置 - 文檔樹 - 最大列出數量]",
     "244": "上次使用後未正常退出,建議執行一次 [文檔樹 - 重建索引]",
     "244": "上次使用後未正常退出,建議執行一次 [文檔樹 - 重建索引]",
-    "245": "上次使用後未正常退出,建議執行一次 [文件樹 - 重建索引],正常退出需使用右側欄面板中的 [退出應用]"
+    "245": "上次使用後未正常退出,建議執行一次 [文件樹 - 重建索引],正常退出需使用右側欄面板中的 [退出應用]",
+    "246": "文件標題不能包含 /,已經使用 _ 替換"
   }
   }
 }
 }

+ 2 - 1
app/appearance/langs/zh_CN.json

@@ -1479,6 +1479,7 @@
     "242": "当前数据库中已经存在该绑定块",
     "242": "当前数据库中已经存在该绑定块",
     "243": "仅列出前 [%d] 个标签(含子标签),如需调整请修改 [设置 - 文档树 - 最大列出数量]",
     "243": "仅列出前 [%d] 个标签(含子标签),如需调整请修改 [设置 - 文档树 - 最大列出数量]",
     "244": "上次使用后未正常退出,建议执行一次 [文档树 - 重建索引]",
     "244": "上次使用后未正常退出,建议执行一次 [文档树 - 重建索引]",
-    "245": "上次使用后未正常退出,建议执行一次 [文档树 - 重建索引],正常退出需使用右侧栏面板中的 [退出应用]"
+    "245": "上次使用后未正常退出,建议执行一次 [文档树 - 重建索引],正常退出需使用右侧栏面板中的 [退出应用]",
+    "246": "文档标题不能包含 /,已经使用 _ 替换"
   }
   }
 }
 }

+ 4 - 1
kernel/model/heading.go

@@ -287,7 +287,10 @@ func Heading2Doc(srcHeadingID, targetBoxID, targetPath string) (srcRootBlockID,
 
 
 	box := Conf.Box(targetBoxID)
 	box := Conf.Box(targetBoxID)
 	headingText := getNodeRefText0(headingNode)
 	headingText := getNodeRefText0(headingNode)
-	headingText = util.FilterFileName(headingText)
+	if strings.Contains(headingText, "/") {
+		headingText = strings.ReplaceAll(headingText, "/", "_")
+		util.PushMsg(Conf.language(246), 7000)
+	}
 
 
 	moveToRoot := "/" == targetPath
 	moveToRoot := "/" == targetPath
 	toHP := path.Join("/", headingText)
 	toHP := path.Join("/", headingText)