diff options
Diffstat (limited to 'tests/Tests/Readers/Markdown.hs')
-rw-r--r-- | tests/Tests/Readers/Markdown.hs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/Tests/Readers/Markdown.hs b/tests/Tests/Readers/Markdown.hs index a5425ffb3..d5ad07a18 100644 --- a/tests/Tests/Readers/Markdown.hs +++ b/tests/Tests/Readers/Markdown.hs @@ -224,6 +224,36 @@ tests = [ testGroup "inline code" , "bracketed text (#2062)" =: "# [hi]\n" =?> headerWith ("hi",[],[]) 1 "[hi]" + , "ATX header without trailing #s" =: + "# Foo bar\n\n" =?> + headerWith ("foo-bar",[],[]) 1 "Foo bar" + , "ATX header without trailing #s" =: + "# Foo bar with # #" =?> + headerWith ("foo-bar-with",[],[]) 1 "Foo bar with #" + , "setext header" =: + "Foo bar\n=\n\n Foo bar 2 \n=" =?> + headerWith ("foo-bar",[],[]) 1 "Foo bar" + <> headerWith ("foo-bar-2",[],[]) 1 "Foo bar 2" + ] + , testGroup "Implicit header references" + [ "ATX header without trailing #s" =: + "# Header\n[header]\n\n[header ]\n\n[ header]" =?> + headerWith ("header",[],[]) 1 "Header" + <> para (link "#header" "" (text "header")) + <> para (text "[header" <> space <> text "]") + <> para (text "[" <> space <> text "header]") + , "ATX header with trailing #s" =: + "# Foo bar #\n[foo bar]\n\n[foo bar ]\n\n[ foo bar]" =?> + headerWith ("foo-bar",[],[]) 1 "Foo bar" + <> para (link "#foo-bar" "" (text "foo bar")) + <> para (text "[foo bar" <> space <> text "]") + <> para (text "[" <> space <> text "foo bar]") + , "setext header" =: + " Header \n=\n\n[header]\n\n[header ]\n\n[ header]" =?> + headerWith ("header",[],[]) 1 "Header" + <> para (link "#header" "" (text "header")) + <> para (text "[header" <> space <> text "]") + <> para (text "[" <> space <> text "header]") ] , testGroup "smart punctuation" [ test markdownSmart "quote before ellipses" |