Footnote definitions are parsing on their own.

This commit is contained in:
Tom Alexander
2023-04-10 11:50:43 -04:00
parent 45db182421
commit e5bc4cb14b
8 changed files with 68 additions and 18 deletions

View File

@@ -21,6 +21,7 @@ use crate::parser::parser_context::ContextElement;
use crate::parser::parser_context::ContextTree;
use crate::parser::parser_context::ExitMatcherNode;
use crate::parser::util::element_trailing_whitespace;
use crate::parser::util::maybe_consume_trailing_whitespace;
use super::element::Element;
use super::error::Res;
@@ -115,12 +116,7 @@ fn section<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str, Sec
// Check if a parent exit matcher is causing the exit
exit_matcher_parser(context, remaining)?;
let (remaining, _trailing_ws) = if context.should_consume_trailing_whitespace() {
opt(parser_with_context!(element_trailing_whitespace)(&parser_context))(remaining)?
} else {
(remaining, None)
};
let (remaining, _trailing_ws) = maybe_consume_trailing_whitespace(context, remaining)?;
let source = get_consumed(input, remaining);
Ok((remaining, Section { source, children }))