Add a test showing the footnote exit matcher is not handling multiple blank lines properly.

This commit is contained in:
Tom Alexander 2023-04-10 12:16:49 -04:00
parent 6fdd613bed
commit 895ee9f3b6
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
2 changed files with 30 additions and 0 deletions

View File

@ -124,4 +124,31 @@ line footnote.";
line footnote."
);
}
#[test]
fn multiline_break() {
let input = "[fn:2] A multi-
line footnote.
not in the footnote.";
let initial_context: ContextTree<'_, '_> = ContextTree::new();
let document_context =
initial_context.with_additional_node(ContextElement::DocumentRoot(input));
let footnote_definition_matcher =
parser_with_context!(footnote_definition)(&document_context);
let (remaining, first_footnote_definition) =
footnote_definition_matcher(input).expect("Parse first footnote_definition");
assert_eq!(remaining, "not in the footnote.");
assert_eq!(
first_footnote_definition.source,
"[fn:2] A multi-
line footnote.
"
);
}
}

View File

@ -33,3 +33,6 @@ foo bar
[fn:2] A multi-
line footnote.
not in the footnote.