Hmmm it seems to be building.
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
//! A single element of text.
|
||||
use crate::parser::parser_with_context::parser_with_context;
|
||||
use crate::parser::text::paragraph_end;
|
||||
|
||||
use super::nom_context::NomContext;
|
||||
// use super::parser_with_context::parser_with_context;
|
||||
use super::text::line_break;
|
||||
@@ -11,6 +14,7 @@ use nom::branch::alt;
|
||||
use nom::combinator::map;
|
||||
use nom::combinator::not;
|
||||
use nom::error::VerboseError;
|
||||
use nom::multi::many_till;
|
||||
use nom::IResult;
|
||||
|
||||
// parser_with_context!(text_element, TextElement, i, context, {
|
||||
@@ -48,3 +52,9 @@ where
|
||||
// todo
|
||||
todo!()
|
||||
}
|
||||
|
||||
pub fn paragraph(input: &str) -> Res<&str, (Vec<TextElement>, &str)> {
|
||||
let initial_context = NomContext::new(¶graph_end);
|
||||
let text_element_parser = parser_with_context!(flat_text_element)(initial_context);
|
||||
many_till(text_element_parser, paragraph_end)(input)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user