aboutsummaryrefslogtreecommitdiff
path: root/tests/Tests/Writers
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert+github@zeitkraut.de>2016-11-26 21:43:46 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2016-11-26 21:43:46 +0100
commitbaa25362a40fe905368f60222ebd8a533bcfe0f9 (patch)
treeece4b41a72bd97e3fb32ba838c21e709bb936de4 /tests/Tests/Writers
parent2873cd82886d1fa557bf3abde37b5ceb3cadf40c (diff)
downloadpandoc-baa25362a40fe905368f60222ebd8a533bcfe0f9.tar.gz
Allow to overwrite top-level division type heuristics (#3258)
Pandoc uses heuristics to determine the most resonable top-level division type when emitting LaTeX or Docbook markup. It is now possible to overwrite this implicitly set top-level division via the `top-level-division` command line parameter. API change (`Text.Pandoc.Options`): the type of the `writerTopLevelDivision` field in of the `WriterOptions` data type is altered from `Division` to `Maybe Division`. The field's default value is changed from `Section` to `Nothing`. Closes: #3197
Diffstat (limited to 'tests/Tests/Writers')
-rw-r--r--tests/Tests/Writers/Docbook.hs2
-rw-r--r--tests/Tests/Writers/LaTeX.hs4
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/Tests/Writers/Docbook.hs b/tests/Tests/Writers/Docbook.hs
index 0e80bcc05..f2a1e9d7b 100644
--- a/tests/Tests/Writers/Docbook.hs
+++ b/tests/Tests/Writers/Docbook.hs
@@ -238,7 +238,7 @@ tests = [ testGroup "line blocks"
docbookTopLevelDiv :: (ToPandoc a) => Division -> a -> String
docbookTopLevelDiv division =
- docbookWithOpts def{ writerTopLevelDivision = division }
+ docbookWithOpts def{ writerTopLevelDivision = Just division }
in
[ test (docbookTopLevelDiv Section) "sections as top-level" $ headers =?>
unlines [ "<sect1>"
diff --git a/tests/Tests/Writers/LaTeX.hs b/tests/Tests/Writers/LaTeX.hs
index 28d6618c1..fb230e89a 100644
--- a/tests/Tests/Writers/LaTeX.hs
+++ b/tests/Tests/Writers/LaTeX.hs
@@ -90,11 +90,11 @@ tests = [ testGroup "code blocks"
latexTopLevelDiv :: (ToPandoc a) => Division -> a -> String
latexTopLevelDiv division =
- latexWithOpts def{ writerTopLevelDivision = division }
+ latexWithOpts def{ writerTopLevelDivision = Just division }
beamerTopLevelDiv :: (ToPandoc a) => Division -> a -> String
beamerTopLevelDiv division =
- latexWithOpts def { writerTopLevelDivision = division
+ latexWithOpts def { writerTopLevelDivision = Just division
, writerBeamer = True }
in
[ test (latexTopLevelDiv Section) "sections as top-level" $ headers =?>