aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2010-12-05 19:27:00 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2010-12-05 19:27:00 -0800
commit5a4609584c84114e8d148f558bed86353c7f0146 (patch)
treec52e39311a6af3dbd8fe0c921ab08ca8ba176460 /tests
parent37dc5d8c5d657d26a358aa4d5f6c14b25ae6cc4b (diff)
downloadpandoc-5a4609584c84114e8d148f558bed86353c7f0146.tar.gz
Fix regression: markdown references should be case-insensitive.
This broke when we added the Key type. We had assumed that the custom case-insensitive Ord instance would ensure case-insensitive matching, but that is not how Data.Map works. * Added a test case for case-insensitivity in markdown-reader-more * Removed old refsMatch from Text.Pandoc.Parsing module; * hid the 'Key' constructor; * dropped the custom Ord and Eq instances, deriving instead; * added fromKey and toKey to convert between Keys and Inline lists; * toKey ensures that keys are case-insensitive, since this is the only way the API provides to construct a Key. Resolves Issue #272.
Diffstat (limited to 'tests')
-rw-r--r--tests/markdown-reader-more.native6
-rw-r--r--tests/markdown-reader-more.txt10
2 files changed, 15 insertions, 1 deletions
diff --git a/tests/markdown-reader-more.native b/tests/markdown-reader-more.native
index 884fe868e..55968af32 100644
--- a/tests/markdown-reader-more.native
+++ b/tests/markdown-reader-more.native
@@ -41,4 +41,8 @@ Pandoc (Meta {docTitle = [Str "Title",Space,Str "spanning",Space,Str "multiple",
[ [ Plain [Str "Third",Space,Str "example",Str "."] ]
]
, Header 2 [Str "Macros"]
-, Para [Math InlineMath "\\langle x,y \\rangle"] ]
+, Para [Math InlineMath "\\langle x,y \\rangle"]
+, Header 2 [Str "Case",Str "-",Str "insensitive",Space,Str "references"]
+, Para [Link [Str "Fum"] ("/fum","")]
+, Para [Link [Str "FUM"] ("/fum","")]
+, Para [Link [Str "bat"] ("/bat","")] ]
diff --git a/tests/markdown-reader-more.txt b/tests/markdown-reader-more.txt
index 5e03d7152..dd43a5df3 100644
--- a/tests/markdown-reader-more.txt
+++ b/tests/markdown-reader-more.txt
@@ -106,3 +106,13 @@ Explanation of examples (@foo) and (@bar).
$\tuple{x,y}$
+## Case-insensitive references
+
+[Fum]
+
+[FUM]
+
+[bat]
+
+[fum]: /fum
+[BAT]: /bat