summaryrefslogtreecommitdiff
path: root/tests/Tests/Readers/LaTeX.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2013-03-09 10:20:12 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2013-03-09 10:33:25 -0800
commitf7229b147314042f946dfded3b441ab0fae260a0 (patch)
treefd40edcaa87e399a7299133b2b9919e102b8407a /tests/Tests/Readers/LaTeX.hs
parentbe165a21ad15d9843d3d79aed651b89f623b49a9 (diff)
LaTeX reader: citation handling changes.
Previously, a LaTeX citation would always be parsed as a Citation element, with the raw LaTeX in the [Inline] part. Now, the LaTeX citation is parsed as a Citation element only if `--biblio` was specified (i.e. only if there is a nonempty set of references in readerReferences). Otherwise it is parsed as raw LaTeX. This will make it possible to simplify some things in the markdown writer. It also makes the LaTeX reader behave more like the Markdown reader.
Diffstat (limited to 'tests/Tests/Readers/LaTeX.hs')
-rw-r--r--tests/Tests/Readers/LaTeX.hs10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/Tests/Readers/LaTeX.hs b/tests/Tests/Readers/LaTeX.hs
index 271b32689..016281ccb 100644
--- a/tests/Tests/Readers/LaTeX.hs
+++ b/tests/Tests/Readers/LaTeX.hs
@@ -2,14 +2,20 @@
module Tests.Readers.LaTeX (tests) where
import Text.Pandoc.Definition
+import Data.Monoid (mempty)
+import Text.CSL (Reference, readBiblioFile)
import Test.Framework
import Tests.Helpers
import Tests.Arbitrary()
import Text.Pandoc.Builder
import Text.Pandoc
+import System.IO.Unsafe (unsafePerformIO)
+
+refs :: [Reference]
+refs = unsafePerformIO $ readBiblioFile "biblio.mods"
latex :: String -> Pandoc
-latex = readLaTeX def
+latex = readLaTeX def{ readerReferences = refs }
infix 4 =:
(=:) :: ToString c
@@ -71,7 +77,7 @@ baseCitation = Citation{ citationId = "item1"
}
rt :: String -> Inlines
-rt = rawInline "latex"
+rt = const mempty -- rawInline "latex"
natbibCitations :: Test
natbibCitations = testGroup "natbib"