raw
1use crate::ast::*;
2use crate::parser::parse_markdown;
3
4#[test]
5fn footnote_definition1() {
6 let doc = parse_markdown("[^foo]: definition").unwrap();
7 assert_eq!(
8 doc,
9 Document {
10 blocks: vec![Block::FootnoteDefinition(FootnoteDefinition {
11 label: "foo".to_owned(),
12 blocks: vec![Block::Paragraph(vec![Inline::Text(
13 "definition".to_owned()
14 )])]
15 })]
16 }
17 );
18}
19
20#[test]
21fn footnote_definition2() {
22 let doc = parse_markdown(
23 "[^foo]: line1
24 line2
25",
26 )
27 .unwrap();
28 assert_eq!(
29 doc,
30 Document {
31 blocks: vec![Block::FootnoteDefinition(FootnoteDefinition {
32 label: "foo".to_owned(),
33 blocks: vec![Block::Paragraph(vec![Inline::Text(
34 "line1\nline2".to_owned()
35 ),])]
36 })]
37 }
38 );
39}
40