From 5770f79c46504c041e2e50ef42b4291b3a5ec59b Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 21 Oct 2022 23:26:45 +0800 Subject: [PATCH 1/3] =?UTF-8?q?:memo:=20=E6=94=B9=E8=BF=9B=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E6=90=9C=E7=B4=A2=E7=B1=BB=E5=9E=8B=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E6=96=87=E6=A1=88=20https://github.com/siyuan-note/siyuan/issu?= =?UTF-8?q?es/6295?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/appearance/langs/en_US.json | 2 +- app/appearance/langs/es_ES.json | 2 +- app/appearance/langs/fr_FR.json | 2 +- app/appearance/langs/zh_CHT.json | 2 +- app/appearance/langs/zh_CN.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.json index b819c4d76..46fc77f88 100644 --- a/app/appearance/langs/en_US.json +++ b/app/appearance/langs/en_US.json @@ -109,7 +109,7 @@ "useDefaultWidth": "Use Default Column Width", "crossPageUse": "Tips for using multiple selections across pages: click at the start position, and after scrolling the page, at the end position ${}", "type": "Type", - "searchType": "Type (search in the following enabled types)", + "searchType": "Type (searches in the enabled types below, the filter option in the global search overrides this setting)", "searchAttr": "Attribute (search not only in the content, but also in the following enabled attributes)", "searchBackmention": "Backlink Mentions (backlink mentions search keywords are obtained from)", "searchVirtualRef": "Virtual reference (virtual reference search keywords are obtained from)", diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.json index a5f8aeafe..740072505 100644 --- a/app/appearance/langs/es_ES.json +++ b/app/appearance/langs/es_ES.json @@ -109,7 +109,7 @@ "useDefaultWidth": "Usar el ancho de columna por defecto", "crossPageUse": "Consejos para utilizar selecciones múltiples a través de las páginas: haga clic en la posición inicial y, después de desplazarse por la página, en la posición final ${}", "type": "Tipo", - "searchType": "Tipo (búscar en los siguientes tipos habilitados)", + "searchType": "Tipos (busque en los tipos habilitados a continuación, la opción de filtro en la búsqueda global anula esta configuración)", "searchAttr": "Atributo (busca no sólo en el contenido, sino también en los siguientes atributos habilitados)", "searchBackmention": "Menciones de Backlinks (las menciones de backlinks de las que se obtienen las palabras clave de la búsqueda)", "searchVirtualRef": "Referencia virtual (las palabras clave de búsqueda de referencias virtuales se obtienen a partir de ellas)", diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.json index 13aca0b42..24314bb29 100644 --- a/app/appearance/langs/fr_FR.json +++ b/app/appearance/langs/fr_FR.json @@ -109,7 +109,7 @@ "useDefaultWidth": "Utiliser la largeur de colonne par défaut", "crossPageUse": "Conseils pour utiliser plusieurs sélections sur plusieurs pages : cliquez à la position de départ et, après avoir fait défiler la page, à la position de fin ${}", "type": "Type", - "searchType": "Type (rechercher dans les types activés suivants)", + "searchType": "Types (recherche dans les types activés ci-dessous, l'option de filtre dans la recherche globale remplace ce paramètre)", "searchAttr": "Attribut (recherche non seulement dans le contenu, mais aussi dans les attributs activés suivants)", "searchBackmention": "Mentions de backlink (les mentions de backlink à partir desquelles les mots-clés de recherche sont obtenus)", "searchVirtualRef": "Référence virtuelle (les mots-clés de recherche de référence virtuelle sont obtenus à partir de)", diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.json index b8c66f329..5f140e1c3 100644 --- a/app/appearance/langs/zh_CHT.json +++ b/app/appearance/langs/zh_CHT.json @@ -109,7 +109,7 @@ "useDefaultWidth": "使用默認列寬", "crossPageUse": "跨頁多選使用提示:在開始位置單擊,滾動頁面以後在結束位置 ${}", "type": "類型", - "searchType": "類型(在以下啟用的類型中進行搜索)", + "searchType": "類型(在以下啟用的類型中進行搜索,全局搜索中的過濾選項會覆蓋該設置)", "searchAttr": "屬性(不僅在內容中進行搜索,同時也會在以下啟用的屬性中搜索)", "searchBackmention": "反鏈提及(反鏈提及搜索關鍵字從以下方式獲得)", "searchVirtualRef": "虛擬引用(虛擬引用搜索關鍵字從以下方式獲得)", diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.json index 713265c03..76e3f21a7 100644 --- a/app/appearance/langs/zh_CN.json +++ b/app/appearance/langs/zh_CN.json @@ -109,7 +109,7 @@ "useDefaultWidth": "使用默认列宽", "crossPageUse": "跨页多选使用提示:在开始位置单击,滚动页面以后在结束位置 ${}", "type": "类型", - "searchType": "类型(在以下启用的类型中进行搜索)", + "searchType": "类型(在以下启用的类型中进行搜索,全局搜索中的过滤选项会覆盖该设置)", "searchAttr": "属性(不仅在内容中进行搜索,同时也会在以下启用的属性中搜索)", "searchBackmention": "反链提及(反链提及搜索关键字从以下方式获得)", "searchVirtualRef": "虚拟引用(虚拟引用搜索关键字从以下方式获得)", From f9784e2b833a4373c7d918540e00b844cb5e100b Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sat, 22 Oct 2022 01:06:56 +0800 Subject: [PATCH 2/3] =?UTF-8?q?:memo:=20=E9=99=90=E5=88=B6=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E5=B0=8F=E5=8A=A9=E6=89=8B=E5=8F=91=E9=80=81=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E3=80=81=E8=AF=AD=E9=9F=B3=E3=80=81=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E5=92=8C=E6=96=87=E4=BB=B6=E5=8D=95=E4=B8=AA=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=9C=80=E5=A4=A7=E4=B8=BA=20`10M`=20https://github.com/siyuan?= =?UTF-8?q?-note/siyuan/issues/6301?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20220414110705-tu2un99.sy | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180320-m0ztypq/20220414110705-tu2un99.sy b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180320-m0ztypq/20220414110705-tu2un99.sy index 04d1e9fed..41d8f50ad 100644 --- a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180320-m0ztypq/20220414110705-tu2un99.sy +++ b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180320-m0ztypq/20220414110705-tu2un99.sy @@ -5,7 +5,7 @@ "Properties": { "id": "20220414110705-tu2un99", "title": "收集箱", - "updated": "20220803164829" + "updated": "20221022010553" }, "Children": [ { @@ -366,10 +366,20 @@ "Type": "NodeCloseParen" } ] - }, + } + ] + }, + { + "ID": "20221022010309-yp452cb", + "Type": "NodeParagraph", + "Properties": { + "id": "20221022010309-yp452cb", + "updated": "20221022010553" + }, + "Children": [ { "Type": "NodeText", - "Data": "​" + "Data": "支持的消息类型为文本、图片、语音、视频和文件,单个图片、语音、视频和文件的大小不超过 10M。" } ] }, From cff937a38432032981dd4ab494db4b696e672d7f Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sat, 22 Oct 2022 01:25:22 +0800 Subject: [PATCH 3/3] =?UTF-8?q?:art:=20=E9=99=90=E5=88=B6=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E5=90=8D=E7=A7=B0=E6=9C=80=E5=A4=A7=E9=95=BF=E5=BA=A6?= =?UTF-8?q?=E4=B8=BA=20`512`=20https://github.com/siyuan-note/siyuan/issue?= =?UTF-8?q?s/6299?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/appearance/langs/en_US.json | 2 +- app/appearance/langs/es_ES.json | 2 +- app/appearance/langs/fr_FR.json | 2 +- app/appearance/langs/zh_CHT.json | 2 +- app/appearance/langs/zh_CN.json | 2 +- kernel/model/file.go | 11 +++++++++++ 6 files changed, 16 insertions(+), 5 deletions(-) diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.json index 46fc77f88..3a8389b9e 100644 --- a/app/appearance/langs/en_US.json +++ b/app/appearance/langs/en_US.json @@ -901,7 +901,7 @@ "103": "The update installation package has been automatically downloaded in the background. When exiting, you will be asked whether to install the new version", "104": "The update installation package failed to download, please check the network connection", "105": "Corrupted data repo have been automatically reset", - "106": "TODO", + "106": "The maximum length of the document name is 512 characters", "107": "Moving document [%s]", "108": "Cleaning obsolete indexes...", "109": "Remove reminder completed [%s]", diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.json index 740072505..9a4cb5100 100644 --- a/app/appearance/langs/es_ES.json +++ b/app/appearance/langs/es_ES.json @@ -901,7 +901,7 @@ "103": "El paquete de instalación de la actualización se ha descargado automáticamente en segundo plano. Al salir, se le preguntará si desea instalar la nueva versión", "104": "El paquete de instalación de la actualización no se pudo descargar, verifique la conexión de red", "105": "El repositorio de datos corruptos se ha restablecido automáticamente", - "106": "TODO", + "106": "La longitud máxima del nombre del documento es de 512 caracteres.", "107": "Moviendo documento [%s]", "108": "Limpiando índices obsoletos...", "109": "Eliminación de recordatorios completada [%s]", diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.json index 24314bb29..22eea6650 100644 --- a/app/appearance/langs/fr_FR.json +++ b/app/appearance/langs/fr_FR.json @@ -901,7 +901,7 @@ "103": "Le package d'installation de la mise à jour a été automatiquement téléchargé en arrière-plan. En quittant, il vous sera demandé si vous souhaitez installer la nouvelle version", "104": "Le package d'installation de la mise à jour n'a pas pu être téléchargé, veuillez vérifier la connexion réseau", "105": "Le référentiel de données corrompu a été automatiquement réinitialisé", - "106": "TODO", + "106": "La longueur maximale du nom du document est de 512 caractères", "107": "Déplacement du document [%s]", "108": "Nettoyage des index obsolètes...", "109": "Supprimer le rappel terminé [%s]", diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.json index 5f140e1c3..af94ca843 100644 --- a/app/appearance/langs/zh_CHT.json +++ b/app/appearance/langs/zh_CHT.json @@ -901,7 +901,7 @@ "103": "已經在後台開始自動下載更新安裝包,退出時將詢問是否安裝新版本", "104": "更新安裝包下載失敗,請檢查網絡連接", "105": "已經自動重置損壞的數據倉庫", - "106": "TODO", + "106": "文檔名最大長度限制為 512 字符", "107": "正在移動文檔 [%s]", "108": "正在清理已過時的索引...", "109": "移除提醒完畢 [%s]", diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.json index 76e3f21a7..b6165f387 100644 --- a/app/appearance/langs/zh_CN.json +++ b/app/appearance/langs/zh_CN.json @@ -901,7 +901,7 @@ "103": "已经在后台开始自动下载更新安装包,退出时将询问是否安装新版本", "104": "更新安装包下载失败,请检查网络连接", "105": "已经自动重置损坏的数据仓库", - "106": "TODO", + "106": "文档名最大长度限制为 512 字符", "107": "正在移动文档 [%s]", "108": "正在清理已过时的索引...", "109": "移除提醒完毕 [%s]", diff --git a/kernel/model/file.go b/kernel/model/file.go index ec552f4c2..678bce1e2 100644 --- a/kernel/model/file.go +++ b/kernel/model/file.go @@ -29,6 +29,7 @@ import ( "strconv" "strings" "time" + "unicode/utf8" "github.com/88250/gulu" "github.com/88250/lute/ast" @@ -1268,6 +1269,11 @@ func RenameDoc(boxID, p, title string) (err error) { } title = gulu.Str.RemoveInvisible(title) + if 512 < utf8.RuneCountInString(title) { + // 限制文档名称最大长度为 `512` https://github.com/siyuan-note/siyuan/issues/6299 + return errors.New(Conf.Language(106)) + } + oldTitle := tree.Root.IALAttr("title") if oldTitle == title { return @@ -1386,6 +1392,11 @@ func CreateDailyNote(boxID string) (p string, existed bool, err error) { func createDoc(boxID, p, title, dom string) (err error) { title = gulu.Str.RemoveInvisible(title) + if 512 < utf8.RuneCountInString(title) { + // 限制文档名称最大长度为 `512` https://github.com/siyuan-note/siyuan/issues/6299 + return errors.New(Conf.Language(106)) + } + baseName := strings.TrimSpace(path.Base(p)) if "" == strings.TrimSuffix(baseName, ".sy") { return errors.New(Conf.Language(16))