From 87be28ed15d20a2e68fd3410fd1c1c9ea5969b84 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Mon, 24 Apr 2023 16:05:46 -0400 Subject: [PATCH] Fix matching of description in links. --- src/parser/regular_link.rs | 3 +-- toy_language.txt | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/parser/regular_link.rs b/src/parser/regular_link.rs index 8793f3f..5432ac0 100644 --- a/src/parser/regular_link.rs +++ b/src/parser/regular_link.rs @@ -77,7 +77,6 @@ pub fn description<'r, 's>( context: Context<'r, 's>, input: &'s str, ) -> Res<&'s str, Vec>> { - let (remaining, _opening_bracket) = tag("[[")(input)?; let parser_context = context.with_additional_node(ContextElement::ExitMatcherNode(ExitMatcherNode { class: ExitClass::Beta, @@ -89,7 +88,7 @@ pub fn description<'r, 's>( parser_with_context!(exit_matcher_parser)(&parser_context), ), |(children, _exit_contents)| !children.is_empty(), - )(remaining)?; + )(input)?; Ok((remaining, children)) } diff --git a/toy_language.txt b/toy_language.txt index d990b43..ad63ddb 100644 --- a/toy_language.txt +++ b/toy_language.txt @@ -1 +1,3 @@ -foo *bar baz * lorem* ipsum +[[https://fizz.buzz/]] + +[[https://fizz.buzz][super cool website]]