summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlbert Krewinkel <tarleb@moltkeplatz.de>2014-05-14 14:49:30 +0200
committerAlbert Krewinkel <tarleb@moltkeplatz.de>2014-05-14 15:00:26 +0200
commitceeb701c254c6dc4c054e10dd151d9ef6f751ad7 (patch)
treea112e13c5faec193cd7981557146ba22f8ec02ed /tests
parent2423f9e6b180bc6b04d222a4b574de995d296f80 (diff)
Org reader: support Pandocs citation extension
Citations are defined via the "normal citation" syntax used in markdown, with the sole difference that newlines are not allowed between "[...]". This is for consistency, as org-mode generally disallows newlines between square brackets. The extension is turned on by default and can be turned off via the default syntax-extension mechanism, i.e. by specifying "org-citation" as the input format. Move `citeKey` from Readers.Markdown into Parsing The function can be used by other readers, so it is made accessible for all parsers.
Diffstat (limited to 'tests')
-rw-r--r--tests/Tests/Readers/Org.hs22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/Tests/Readers/Org.hs b/tests/Tests/Readers/Org.hs
index 4ef7a7731..ca97ba348 100644
--- a/tests/Tests/Readers/Org.hs
+++ b/tests/Tests/Readers/Org.hs
@@ -225,6 +225,28 @@ tests =
]
)
"echo 'Hello, World'")
+
+ , "Citation" =:
+ "[@nonexistent]" =?>
+ let citation = Citation
+ { citationId = "nonexistent"
+ , citationPrefix = []
+ , citationSuffix = []
+ , citationMode = NormalCitation
+ , citationNoteNum = 0
+ , citationHash = 0}
+ in (para $ cite [citation] "[@nonexistent]")
+
+ , "Citation containing text" =:
+ "[see @item1 p. 34-35]" =?>
+ let citation = Citation
+ { citationId = "item1"
+ , citationPrefix = [Str "see"]
+ , citationSuffix = [Space ,Str "p.",Space,Str "34-35"]
+ , citationMode = NormalCitation
+ , citationNoteNum = 0
+ , citationHash = 0}
+ in (para $ cite [citation] "[see @item1 p. 34-35]")
]
, testGroup "Meta Information" $