aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2016-05-27 09:19:38 +0200
committerAlbert Krewinkel <albert@zeitkraut.de>2016-05-27 21:19:28 +0200
commitf226cb88b040dcd19e09ca7772ee0c6172eaecc2 (patch)
tree666a0d47a61fac63a010e1e8ca65ca5330e5782b /tests
parentf54873d5ea757787ec816336c61c24a813799554 (diff)
downloadpandoc-f226cb88b040dcd19e09ca7772ee0c6172eaecc2.tar.gz
Org reader: support org-ref style citations
The *org-ref* package is an org-mode extension commonly used to manage citations in org documents. Basic support for the `cite:citeKey` and `[[cite:citeKey][prefix text::suffix text]]` syntax is added.
Diffstat (limited to 'tests')
-rw-r--r--tests/Tests/Readers/Org.hs36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/Tests/Readers/Org.hs b/tests/Tests/Readers/Org.hs
index 780053059..7090e8b49 100644
--- a/tests/Tests/Readers/Org.hs
+++ b/tests/Tests/Readers/Org.hs
@@ -300,6 +300,42 @@ tests =
, citationHash = 0}
in (para $ cite [citation] "[see @item1 p. 34-35]")
+ , "Org-ref simple citation" =:
+ "cite:pandoc" =?>
+ let citation = Citation
+ { citationId = "pandoc"
+ , citationPrefix = mempty
+ , citationSuffix = mempty
+ , citationMode = AuthorInText
+ , citationNoteNum = 0
+ , citationHash = 0
+ }
+ in (para $ cite [citation] "cite:pandoc")
+
+ , "Org-ref simple citep citation" =:
+ "citep:pandoc" =?>
+ let citation = Citation
+ { citationId = "pandoc"
+ , citationPrefix = mempty
+ , citationSuffix = mempty
+ , citationMode = NormalCitation
+ , citationNoteNum = 0
+ , citationHash = 0
+ }
+ in (para $ cite [citation] "citep:pandoc")
+
+ , "Org-ref extended citation" =:
+ "[[citep:Dominik201408][See page 20::, for example]]" =?>
+ let citation = Citation
+ { citationId = "Dominik201408"
+ , citationPrefix = toList "See page 20"
+ , citationSuffix = toList ", for example"
+ , citationMode = NormalCitation
+ , citationNoteNum = 0
+ , citationHash = 0
+ }
+ in (para $ cite [citation] "[[citep:Dominik201408][See page 20::, for example]]")
+
, "Inline LaTeX symbol" =:
"\\dots" =?>
para "…"