Add paragraph parser.

This commit is contained in:
Tom Alexander
2022-10-15 14:16:52 -04:00
parent ba25f5b5ca
commit 9d534aa627
4 changed files with 19 additions and 13 deletions

View File

@@ -28,6 +28,7 @@ use nom::IResult;
use super::nom_context::NomContext;
use super::parser_with_context::parser_with_context;
use super::text_element_parser::paragraph;
pub type Res<T, U> = IResult<T, U, VerboseError<T>>;
@@ -137,6 +138,6 @@ pub fn paragraph_end(input: &str) -> Res<&str, &str> {
pub fn document(input: &str) -> Res<&str, Vec<(Vec<TextElement>, &str)>> {
let initial_context = NomContext::new(Rc::new(RefCell::new(paragraph_end)));
todo!()
// many1(parser_with_context!(paragraph)(initial_context))(input)
let ret = many1(parser_with_context!(paragraph)(&initial_context))(input);
ret
}