summaryrefslogtreecommitdiff
path: root/test/Tests
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2022-06-06 18:24:28 +0200
committerGitHub <noreply@github.com>2022-06-06 09:24:28 -0700
commite5c41f11de39d71241bdaf4cc9cd6890846db742 (patch)
treee28ae0de026d37ee201c6b68c9f39a0a5fc71531 /test/Tests
parent78443004145adb85665cf799ccdfc115f64e47d1 (diff)
ConTeXt writer: use "sectionlevel" environment for headings (#8106)
The document hierarchy is now conveyed using the `\startsectionlevel`/`\stopsectionlevel` by default. This makes it easy to include pandoc-generated snippets in documents at arbitrary levels. The more semantic environments "chapter", "section", "subsection", etc. are used if the `--top-level-division` command line parameter is set to a non-default value. Closes: #5539
Diffstat (limited to 'test/Tests')
-rw-r--r--test/Tests/Writers/ConTeXt.hs12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/Tests/Writers/ConTeXt.hs b/test/Tests/Writers/ConTeXt.hs
index 254a5fad6..aced9ab7d 100644
--- a/test/Tests/Writers/ConTeXt.hs
+++ b/test/Tests/Writers/ConTeXt.hs
@@ -19,8 +19,10 @@ context' = unpack . purely (writeConTeXt def{ writerWrapText = WrapNone }) . toP
contextNtb :: (ToPandoc a) => a -> String
contextNtb = unpack . purely (writeConTeXt def{ writerExtensions = enableExtension Ext_ntb pandocExtensions }) . toPandoc
-contextDiv :: (ToPandoc a) => a -> String
-contextDiv = unpack . purely (writeConTeXt def{ writerSectionDivs = True }) . toPandoc
+contextSection :: (ToPandoc a) => a -> String
+contextSection = unpack
+ . purely (writeConTeXt def{ writerTopLevelDivision = TopLevelSection })
+ . toPandoc
{-
"my test" =: X =?> Y
@@ -56,8 +58,10 @@ tests =
, testGroup "headers"
[ "level 1" =:
headerWith ("my-header",[],[]) 1 "My header" =?>
- "\\section[title={My header},reference={my-header}]"
- , test contextDiv "section-divs" $
+ "\\startsectionlevel[title={My header},reference={my-header}]\n" <>
+ "\n" <>
+ "\\stopsectionlevel"
+ , test contextSection "Section as top-level" $
( headerWith ("header1", [], []) 1 (text "Header1")
<> headerWith ("header2", [], []) 2 (text "Header2")
<> headerWith ("header3", [], []) 3 (text "Header3")