wayver's git archive


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

sable-markdown/src/parser/inline/tests/strikethrough.rs@main

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

1use crate::{ast::*, parser::parse_markdown};
2
3#[test]
4fn strikethrough1() {
5    let doc = parse_markdown("~~text~~").unwrap();
6    assert_eq!(
7        doc,
8        Document {
9            blocks: vec![Block::Paragraph(vec![Inline::Strikethrough(vec![
10                Inline::Text("text".to_string())
11            ])])],
12        }
13    );
14}
15
16#[test]
17fn strikethrough2() {
18    let doc = parse_markdown("~~text~~~").unwrap();
19    assert_eq!(
20        doc,
21        Document {
22            blocks: vec![Block::Paragraph(vec![Inline::Strikethrough(vec![
23                Inline::Text("text~".to_string())
24            ])])],
25        }
26    );
27}
28
29#[test]
30fn strikethrough3() {
31    let doc = parse_markdown("~~~text~~~").unwrap();
32    assert_eq!(
33        doc,
34        Document {
35            blocks: vec![Block::Paragraph(vec![
36                Inline::Text("~".to_string()),
37                Inline::Strikethrough(vec![Inline::Text("text~".to_string())])
38            ])],
39        }
40    );
41}
42