Move the text element parser into the text module.

This commit is contained in:
Tom Alexander
2022-12-18 03:11:56 -05:00
parent 46672b40b2
commit 4ac3a47deb
6 changed files with 34 additions and 31 deletions

View File

@@ -5,9 +5,9 @@ use super::parser_context::ContextElement;
use super::parser_context::ExitMatcherNode;
use super::text::blank_line;
use super::text::line_break;
use super::text::text_element;
use super::text::Paragraph;
use super::text::TextElement;
use super::text_element_parser::flat_text_element;
use super::token::Token;
use super::Context;
use nom::branch::alt;
@@ -27,7 +27,7 @@ pub fn paragraph<'s, 'r>(context: Context<'r, 's>, i: &'s str) -> Res<&'s str, P
}))
.with_additional_node(ContextElement::StartOfParagraph);
let (remaining, (many, till)) =
context_many_till(&paragraph_context, flat_text_element, context_paragraph_end)(i)?;
context_many_till(&paragraph_context, text_element, context_paragraph_end)(i)?;
let many = many
.into_iter()
.filter_map(|token| match token {