From c039e0d62cd9d55b49f8fd2411e8dc57102a1f5e Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Thu, 12 Oct 2023 17:32:29 -0400 Subject: [PATCH] Keywords without affiliated keywords should be lower priority than paragraphs with affiliated keywords. --- src/parser/element_parser.rs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/parser/element_parser.rs b/src/parser/element_parser.rs index 92b1089..bf04388 100644 --- a/src/parser/element_parser.rs +++ b/src/parser/element_parser.rs @@ -219,6 +219,18 @@ fn _element<'b, 'g, 'r, 's>( Element::Keyword ); + if can_be_paragraph { + // Paragraph with affiliated keyword + ak_element!( + paragraph, + &mut affiliated_keywords, + post_affiliated_keywords_input, + context, + input, + Element::Paragraph + ); + } + // Keyword without affiliated keywords ak_element!( keyword, @@ -230,16 +242,6 @@ fn _element<'b, 'g, 'r, 's>( ); if can_be_paragraph { - // Paragraph with affiliated keyword - ak_element!( - paragraph, - &mut affiliated_keywords, - post_affiliated_keywords_input, - context, - input, - Element::Paragraph - ); - // Paragraph without affiliated keyword ak_element!( paragraph,