aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2020-03-04 08:42:57 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2020-03-04 08:42:57 -0800
commitc78b30bd286f49cb0a0951a1f022e2626a9295dd (patch)
tree34b778923a291c2208ea1ca73d58848059684e66
parent43711ade22dfd90600a0b2bdfd04fd0936e4052b (diff)
downloadpandoc-c78b30bd286f49cb0a0951a1f022e2626a9295dd.tar.gz
EPUB writer: fix regression on detection of front/back/bodymatter.
This bug caused sections with epub:type "dedication" to be misplaced in bodymatter instead of frontmatter as specified in the manual. The same problem would affect other epub:types. The pattern matching needed to be changed with the use of `makeSection`. Closes #6170.
-rw-r--r--src/Text/Pandoc/Writers/EPUB.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs
index 7605d3a4b..b000869e4 100644
--- a/src/Text/Pandoc/Writers/EPUB.hs
+++ b/src/Text/Pandoc/Writers/EPUB.hs
@@ -595,7 +595,8 @@ pandocToEPUB version opts doc = do
<> cssvars True <> vars } pdoc
where (pdoc, bodyType) =
case bs of
- (Header _ (_,_,kvs) xs : _) ->
+ (Div (_,"section":_,kvs)
+ (Header _ _ xs : _) : _) ->
-- remove notes or we get doubled footnotes
(Pandoc (setMeta "title"
(walk removeNote $ fromList xs) nullMeta) bs,