From e984d0ecbb3edddeb314aaa1bcf80c53ccbd55ad Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Tue, 19 Dec 2023 22:36:30 +0800 Subject: [PATCH 1/3] :art: Improve kernel stability https://github.com/siyuan-note/siyuan/issues/9912 --- kernel/model/attribute_view.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go index 5cced0a87..93cc157fb 100644 --- a/kernel/model/attribute_view.go +++ b/kernel/model/attribute_view.go @@ -1694,8 +1694,6 @@ func replaceAttributeViewBlock(operation *Operation, tx *Transaction) (err error return } - WaitForWritingFiles() - var node *ast.Node if !operation.IsDetached { node, _, _ = getNodeByBlockID(tx, operation.NextID) From 6e0524b235444c31851df32b2086733fd12ab4d5 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Tue, 19 Dec 2023 23:12:26 +0800 Subject: [PATCH 2/3] :art: `Convert network images to local` supports URL-encoded local file names https://github.com/siyuan-note/siyuan/issues/9929 --- kernel/model/assets.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/model/assets.go b/kernel/model/assets.go index 85f66aac9..71c9c7d12 100644 --- a/kernel/model/assets.go +++ b/kernel/model/assets.go @@ -111,6 +111,10 @@ func NetImg2LocalAssets(rootID, originalURL string) (err error) { // `网络图片转换为本地图片` 支持处理 `file://` 本地路径图片 https://github.com/siyuan-note/siyuan/issues/6546 u := string(dest)[7:] + unescaped, _ := url.PathUnescape(u) + if unescaped != u { + u = unescaped + } if !gulu.File.IsExist(u) || gulu.File.IsDir(u) { return ast.WalkSkipChildren } From c4faf7c564e6986cb172b221e3b1150bb64c1b8a Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Tue, 19 Dec 2023 23:12:39 +0800 Subject: [PATCH 3/3] :art: `Convert network images to local` supports URL-encoded local file names https://github.com/siyuan-note/siyuan/issues/9929 --- kernel/model/assets.go | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/model/assets.go b/kernel/model/assets.go index 71c9c7d12..d47ec3194 100644 --- a/kernel/model/assets.go +++ b/kernel/model/assets.go @@ -113,6 +113,7 @@ func NetImg2LocalAssets(rootID, originalURL string) (err error) { u := string(dest)[7:] unescaped, _ := url.PathUnescape(u) if unescaped != u { + // `Convert network images to local` supports URL-encoded local file names https://github.com/siyuan-note/siyuan/issues/9929 u = unescaped } if !gulu.File.IsExist(u) || gulu.File.IsDir(u) {