forked from logseq/logseq
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix mailto and other links creating invalid pages
Fixes logseq#9346 and fixes logseq#5926. Also fixes case where relative paths for unsupported paths were creating pages per directory e.g. `deps/graph-parser/yarn.lock` created deps and graph-parser pages
- Loading branch information
1 parent
adef15d
commit b26d83d
Showing
4 changed files
with
11 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -360,15 +360,21 @@ | |
(remove built-in-pages) | ||
set))))) | ||
|
||
(testing "for file and web uris" | ||
(testing "for file, mailto, web and other uris" | ||
(let [conn (ldb/start-conn) | ||
built-in-pages (set (map string/lower-case default-db/built-in-pages-names))] | ||
(graph-parser/parse-file conn | ||
"foo.md" | ||
(str "- [Filename.txt](file:///E:/test/Filename.txt)\n" | ||
(str "- [foo]([[bar]])\n" | ||
;; all of the uris below do not create pages | ||
"- \n" | ||
"- [Filename.txt](file:///E:/test/Filename.txt)\n" | ||
"- [mail](mailto:[email protected]?subject=TestSubject)\n" | ||
"- [onenote link](onenote:https://d.docs.live.net/b2127346582e6386a/blablabla/blablabla/blablabla%20blablabla.one#Etat%202019§ion-id={133DDF16-9A1F-4815-9A05-44303784442E6F94}&page-id={3AAB677F0B-328F-41D0-AFF5-66408819C085}&end)\n" | ||
"- [lock file](deps/graph-parser/yarn.lock)" | ||
"- [example](https://example.com)") | ||
{}) | ||
(is (= #{"foo"} | ||
(is (= #{"foo" "bar"} | ||
(->> (d/q '[:find (pull ?b [*]) | ||
:in $ | ||
:where [?b :block/name]] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters