diff options
author | John MacFarlane <jgm@berkeley.edu> | 2016-06-05 11:58:47 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2016-06-05 11:58:47 -0700 |
commit | a184aec7076eedf01deea08a2ec64c5340d00e9c (patch) | |
tree | fb244f17220372fd41130b7d71b6a88c988582d7 /tests/Tests/Readers/Org.hs | |
parent | 97f8f4ad4bc190ba0c27713eeea94f661634d418 (diff) | |
parent | 8a9f5915ab822b476c270f46e8a800982b018ba3 (diff) | |
download | pandoc-a184aec7076eedf01deea08a2ec64c5340d00e9c.tar.gz |
Merge pull request #2964 from tarleb/org-berkeley-ref
Org reader: "Berkeley style" citation support
Diffstat (limited to 'tests/Tests/Readers/Org.hs')
-rw-r--r-- | tests/Tests/Readers/Org.hs | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/Tests/Readers/Org.hs b/tests/Tests/Readers/Org.hs index 9bd999b01..ab50aa49c 100644 --- a/tests/Tests/Readers/Org.hs +++ b/tests/Tests/Readers/Org.hs @@ -336,6 +336,55 @@ tests = } in (para $ cite [citation] "[[citep:Dominik201408][See page 20::, for example]]") + , testGroup "Berkeley-style citations" $ + let pandocCite = Citation + { citationId = "Pandoc" + , citationPrefix = mempty + , citationSuffix = mempty + , citationMode = NormalCitation + , citationNoteNum = 0 + , citationHash = 0 + } + pandocInText = pandocCite { citationMode = AuthorInText } + dominikCite = Citation + { citationId = "Dominik201408" + , citationPrefix = mempty + , citationSuffix = mempty + , citationMode = NormalCitation + , citationNoteNum = 0 + , citationHash = 0 + } + dominikInText = dominikCite { citationMode = AuthorInText } + in [ + "Berkeley-style in-text citation" =: + "See @Dominik201408." =?> + (para $ "See " + <> cite [dominikInText] "@Dominik201408" + <> ".") + + , "Berkeley-style parenthetical citation list" =: + "[(cite): see; @Dominik201408;also @Pandoc; and others]" =?> + let pandocCite' = pandocCite { + citationPrefix = toList "also" + , citationSuffix = toList "and others" + } + dominikCite' = dominikCite { + citationPrefix = toList "see" + } + in (para $ cite [dominikCite', pandocCite'] "") + + , "Berkeley-style plain citation list" =: + "[cite: See; @Dominik201408; and @Pandoc; and others]" =?> + let pandocCite' = pandocInText { + citationPrefix = toList "and" + } + in (para $ "See " + <> cite [dominikInText] "" + <> "," <> space + <> cite [pandocCite'] "" + <> "," <> space <> "and others") + ] + , "Inline LaTeX symbol" =: "\\dots" =?> para "…" |