summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNikolay Yakimov <root@livid.pp.ru>2015-04-17 17:30:55 +0300
committerNikolay Yakimov <root@livid.pp.ru>2015-04-20 01:31:45 +0300
commitc1ff16515412d8466e1415d449d5235c2af74c3e (patch)
tree411f1338537347848360256a1a4f77c5dc1f62be /tests
parent1a69896d8f2c676aaf8563e1a7b2ba5870597f54 (diff)
MD Reader: Tests for links/footnotes after citations
In-text citation suffix clashes with links and footnotes
Diffstat (limited to 'tests')
-rw-r--r--tests/Tests/Readers/Markdown.hs41
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]")
+ )
+ ]
]