From aa0a0b890e58bb09de62d5af41dc401e5b10eab7 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Fri, 6 Oct 2023 23:48:55 -0400 Subject: [PATCH] Relative paths are file links, absolute paths are fuzzy. --- org_mode_samples/object/regular_link/file_link.org | 3 +++ org_mode_samples/object/regular_link/fuzzy_link.org | 1 + src/parser/regular_link.rs | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/org_mode_samples/object/regular_link/file_link.org b/org_mode_samples/object/regular_link/file_link.org index 2253839..a57300d 100644 --- a/org_mode_samples/object/regular_link/file_link.org +++ b/org_mode_samples/object/regular_link/file_link.org @@ -1,3 +1,6 @@ +[[./simple.org]] +[[../simple.org]] +[[/simple.org]] [[file:simple.org]] [[file:sim ple.org]] diff --git a/org_mode_samples/object/regular_link/fuzzy_link.org b/org_mode_samples/object/regular_link/fuzzy_link.org index 17ebd7a..ce26f30 100644 --- a/org_mode_samples/object/regular_link/fuzzy_link.org +++ b/org_mode_samples/object/regular_link/fuzzy_link.org @@ -1,4 +1,5 @@ [[elisp.org]] +[[/elisp.org]] [[eli sp.org]] diff --git a/src/parser/regular_link.rs b/src/parser/regular_link.rs index d74b272..1c983d9 100644 --- a/src/parser/regular_link.rs +++ b/src/parser/regular_link.rs @@ -233,7 +233,7 @@ fn apply_link_templates<'b, 'g, 'r, 's>( fn file_path_reg<'s>(input: OrgSource<'s>) -> Res, PathReg<'s>> { let (remaining, (raw_link, (_, path, search_option))) = consumed(tuple(( - tag("file:"), + alt((tag("file:"), peek(tag(".")))), recognize(many_till(anychar, alt((peek(tag("::")), eof)))), opt(map(tuple((tag("::"), rest)), |(_, search_option)| { search_option