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.
This commit is contained in:
John MacFarlane 2020-03-04 08:42:57 -08:00
parent 43711ade22
commit c78b30bd28

View file

@ -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,