diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-04-19 16:49:34 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-04-19 16:49:34 -0700 |
commit | 5b5813c30b458d3eee96e8e5be5c44451b2037b8 (patch) | |
tree | 3dda9f54b39c96c37e354fecf9740c1442acf964 /tests/Tests | |
parent | 1a69896d8f2c676aaf8563e1a7b2ba5870597f54 (diff) | |
parent | e83968412e308bfd34c7ba4d1ad01592878fc95a (diff) | |
download | pandoc-5b5813c30b458d3eee96e8e5be5c44451b2037b8.tar.gz |
Merge pull request #2090 from lierdakil/issue2083
Fix for #2083 (citation suffix clashes with links and footnotes)
Diffstat (limited to 'tests/Tests')
-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]") + ) + ] ] |