diff options
author | Nikolay Yakimov <root@livid.pp.ru> | 2015-04-17 17:30:55 +0300 |
---|---|---|
committer | Nikolay Yakimov <root@livid.pp.ru> | 2015-04-20 01:31:45 +0300 |
commit | c1ff16515412d8466e1415d449d5235c2af74c3e (patch) | |
tree | 411f1338537347848360256a1a4f77c5dc1f62be /tests/Tests/Readers | |
parent | 1a69896d8f2c676aaf8563e1a7b2ba5870597f54 (diff) | |
download | pandoc-c1ff16515412d8466e1415d449d5235c2af74c3e.tar.gz |
MD Reader: Tests for links/footnotes after citations
In-text citation suffix clashes with links and footnotes
Diffstat (limited to 'tests/Tests/Readers')
-rw-r--r-- | tests/Tests/Readers/Markdown.hs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/Tests/Readers/Markdown.hs b/tests/Tests/Readers/Markdown.hs index 4ae144556..02d49a70e 100644 --- a/tests/Tests/Readers/Markdown.hs +++ b/tests/Tests/Readers/Markdown.hs @@ -324,4 +324,45 @@ tests = [ testGroup "inline code" } ] "@1657:huyghens") ] + , let citation = cite [Citation "cita" [] [] AuthorInText 0 0] (str "@cita") + in testGroup "footnote/link following citation" -- issue #2083 + [ "footnote" =: + unlines [ "@cita[^note]" + , "" + , "[^note]: note" ] =?> + para ( + citation <> note (para $ str "note") + ) + , "normal link" =: + "@cita [link](http://www.com)" =?> + para ( + citation <> space <> link "http://www.com" "" (str "link") + ) + , "reference link" =: + unlines [ "@cita [link][link]" + , "" + , "[link]: http://www.com" ] =?> + para ( + citation <> space <> link "http://www.com" "" (str "link") + ) + , "short reference link" =: + unlines [ "@cita [link]" + , "" + , "[link]: http://www.com" ] =?> + para ( + citation <> space <> link "http://www.com" "" (str "link") + ) + , "implicit header link" =: + unlines [ "# Header" + , "@cita [Header]" ] =?> + headerWith ("header",[],[]) 1 (str "Header") <> para ( + citation <> space <> link "#header" "" (str "Header") + ) + , "regular citation" =: + "@cita [foo]" =?> + para ( + cite [Citation "cita" [] [Str "foo"] AuthorInText 0 0] + (str "@cita" <> space <> str "[foo]") + ) + ] ] |