Cleaning up.

This commit is contained in:
Tom Alexander
2022-07-16 21:36:06 -04:00
parent 8357837571
commit b3b2874cc2
4 changed files with 24 additions and 75 deletions

View File

@@ -24,6 +24,7 @@ use nom::sequence::tuple;
use nom::IResult;
use super::nom_context::NomContext;
use super::text_element_parser::paragraph;
pub type Res<T, U> = IResult<T, U, VerboseError<T>>;
@@ -127,11 +128,11 @@ pub fn link_end(input: &str) -> Res<&str, TextElement> {
map(symbol("]"), TextElement::Symbol)(input)
}
pub fn paragraph(input: &str) -> Res<&str, (Vec<TextElement>, &str)> {
// let initial_context = NomContext::new(&paragraph_end);
// many_till(text_element(initial_context), paragraph_end)(input)
todo!()
}
// pub fn paragraph(input: &str) -> Res<&str, (Vec<TextElement>, &str)> {
// // let initial_context = NomContext::new(&paragraph_end);
// // many_till(text_element(initial_context), paragraph_end)(input)
// todo!()
// }
pub fn paragraph_end(input: &str) -> Res<&str, &str> {
recognize(tuple((map(line_break, TextElement::LineBreak), blank_line)))(input)