wayver's git archive


an obsidian renderer
git clone https://git.wayver.dev/sable

sable-markdown/src/parser/blocks/tests/footnote_definition.rs@337ba67f65eaa17b44e371af7c0f0c761d6aa914

raw
Date Commit Message Author Files + -
2026-02-23 01:55 initial mvp wayverd 139 17808 0
...

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