From 970fd04ad4b2f75110bec2b7ca65b09e82716c99 Mon Sep 17 00:00:00 2001 From: Charlie Date: Mon, 11 May 2026 09:56:11 +0800 Subject: [PATCH] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/main/logseq/api/plugin.cljs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/logseq/api/plugin.cljs b/src/main/logseq/api/plugin.cljs index 10ddf84d76..bcaf008fd3 100644 --- a/src/main/logseq/api/plugin.cljs +++ b/src/main/logseq/api/plugin.cljs @@ -59,9 +59,11 @@ (defn- sub-path? [root-dir path] - (let [relative (.relative util/node-path root-dir path)] + (let [relative (.relative util/node-path root-dir path) + parent-dir-segment? (or (= relative "..") + (string/starts-with? relative (str ".." (.-sep util/node-path))))] (or (string/blank? relative) - (and (not (string/starts-with? relative "..")) + (and (not parent-dir-segment?) (not (.isAbsolute util/node-path relative)))))) (defn- assert-storage-path!