Integrate plain list parser into the parser tree.
This commit is contained in:
@@ -11,6 +11,7 @@ use crate::parser::parser_context::ContextElement;
|
||||
use crate::parser::parser_context::ExitMatcherNode;
|
||||
use crate::parser::parser_with_context::parser_with_context;
|
||||
|
||||
use super::element::non_paragraph_element;
|
||||
use super::error::Res;
|
||||
use super::lesser_element::Paragraph;
|
||||
use super::util::blank_line;
|
||||
@@ -35,6 +36,10 @@ pub fn paragraph<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s st
|
||||
}
|
||||
|
||||
fn paragraph_end<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str, &'s str> {
|
||||
// TODO: Other elements should also end paragraphs
|
||||
alt((recognize(tuple((line_ending, many1(blank_line)))), eof))(input)
|
||||
let non_paragraph_element_matcher = parser_with_context!(non_paragraph_element)(context);
|
||||
alt((
|
||||
recognize(tuple((line_ending, many1(blank_line)))),
|
||||
recognize(non_paragraph_element_matcher),
|
||||
eof,
|
||||
))(input)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user