From 038535174bf52cf6444f4d3ccd656a55b214b522 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sun, 8 Oct 2023 09:34:47 -0400 Subject: [PATCH] Do not allow empty path in plain links and do not remove "//" in regular links. --- src/parser/plain_link.rs | 2 +- src/parser/regular_link.rs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/parser/plain_link.rs b/src/parser/plain_link.rs index 1d0bda6..ff74535 100644 --- a/src/parser/plain_link.rs +++ b/src/parser/plain_link.rs @@ -142,7 +142,7 @@ fn file_path_plain<'b, 'g, 'r, 's>( parse_file_and_application, ), tag(":"), - recognize(opt(parser_with_context!(path_plain)(&parser_context))), + parser_with_context!(path_plain)(&parser_context), opt(map( tuple(( tag("::"), diff --git a/src/parser/regular_link.rs b/src/parser/regular_link.rs index fdb7fae..caeefd8 100644 --- a/src/parser/regular_link.rs +++ b/src/parser/regular_link.rs @@ -271,9 +271,8 @@ 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),