From ba8115c648efb031034f3790094d251be8ce41dc Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sun, 8 Oct 2023 09:16:48 -0400 Subject: [PATCH] Remove "//" from file paths. --- src/parser/plain_link.rs | 4 +++- src/parser/regular_link.rs | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/parser/plain_link.rs b/src/parser/plain_link.rs index 1fec0e1..84a5462 100644 --- a/src/parser/plain_link.rs +++ b/src/parser/plain_link.rs @@ -132,12 +132,14 @@ fn file_path_plain<'b, 'g, 'r, 's>( exit_matcher: &path_plain_end, }); let parser_context = context.with_additional_node(&parser_context); - let (remaining, (raw_link, (application, _, path, search_option))) = consumed(tuple(( + let (remaining, (raw_link, (_, application, _, _, path, search_option))) = consumed(tuple(( + peek(tag("file")), map_parser( parser_with_context!(protocol)(&parser_context), parse_file_and_application, ), tag(":"), + opt(tag("//")), parser_with_context!(path_plain)(&parser_context), opt(map( tuple(( diff --git a/src/parser/regular_link.rs b/src/parser/regular_link.rs index bd6568b..b80e5cc 100644 --- a/src/parser/regular_link.rs +++ b/src/parser/regular_link.rs @@ -268,8 +268,9 @@ fn file_path_reg<'b, 'g, 'r, 's>( parse_file_and_application, ), tag(":"), + opt(tag("//")), )), - |(_, application, _)| application, + |(_, application, _, _)| application, ), map(peek(tag(".")), |_| None), map(peek(tag("/")), |_| None),