Parser for dynamic blocks.

This commit is contained in:
Tom Alexander
2023-04-19 13:51:18 -04:00
parent 0d07a6aad3
commit cab5ba70e5
2 changed files with 91 additions and 3 deletions

View File

@@ -67,10 +67,9 @@ pub fn greater_block<'r, 's>(
let element_matcher = parser_with_context!(element)(&parser_context);
let exit_matcher = parser_with_context!(exit_matcher_parser)(&parser_context);
// TODO: Not handling nested greater blocks
// Check for a completely empty block
let (remaining, children) = match consumed(many_till(blank_line, exit_matcher))(remaining) {
Ok((remaining, (whitespace, (children, _exit_contents)))) => (
Ok((remaining, (whitespace, (_children, _exit_contents)))) => (
remaining,
vec![Element::Paragraph(Paragraph::of_text(whitespace))],
),