Relative paths are file links, absolute paths are fuzzy.

This commit is contained in:
Tom Alexander 2023-10-06 23:48:55 -04:00
parent ab33730830
commit aa0a0b890e
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
3 changed files with 5 additions and 1 deletions

View File

@ -1,3 +1,6 @@
[[./simple.org]]
[[../simple.org]]
[[/simple.org]]
[[file:simple.org]] [[file:simple.org]]
[[file:sim ple.org]] [[file:sim ple.org]]

View File

@ -1,4 +1,5 @@
[[elisp.org]] [[elisp.org]]
[[/elisp.org]]
[[eli [[eli
sp.org]] sp.org]]

View File

@ -233,7 +233,7 @@ fn apply_link_templates<'b, 'g, 'r, 's>(
fn file_path_reg<'s>(input: OrgSource<'s>) -> Res<OrgSource<'s>, PathReg<'s>> { fn file_path_reg<'s>(input: OrgSource<'s>) -> Res<OrgSource<'s>, PathReg<'s>> {
let (remaining, (raw_link, (_, path, search_option))) = consumed(tuple(( let (remaining, (raw_link, (_, path, search_option))) = consumed(tuple((
tag("file:"), alt((tag("file:"), peek(tag(".")))),
recognize(many_till(anychar, alt((peek(tag("::")), eof)))), recognize(many_till(anychar, alt((peek(tag("::")), eof)))),
opt(map(tuple((tag("::"), rest)), |(_, search_option)| { opt(map(tuple((tag("::"), rest)), |(_, search_option)| {
search_option search_option