git.iko.soy/typeable/pandoc
on master help sign in
HTML reader: ensure we don't produce level 0 headers,

even for chapter sections in epubs. This causes problems because writers aren't set up to expect these. This fixes the most immediate problem in #4076. It would be good to think more about how to propagate the information that top-level headers are chapters from the reader to the writer.

commitb9cdef03f071b5ced19d094601a2e8cbd16748d6 authorJohn MacFarlane <jgm@berkeley.edu> dateSat 18 Nov 2017, 14:08 (9 years ago) parent9916f42
1 file changed+5−5
src/Text/Pandoc/Readers/HTML.hs+5−5
src/Text/Pandoc/Readers/HTML.hs+5−5
@@ -429,11 +429,11 @@ headerLevel :: PandocMonad m => Text -> TagParser m Int
429429headerLevel tagtype =
430430 case safeRead (T.unpack (T.drop 1 tagtype)) of
431431 Just level ->
432− try (do
433− guardEnabled Ext_epub_html_exts
434− asks inChapter >>= guard
435− return (level - 1))
436− <|>
432+-- try (do
433+-- guardEnabled Ext_epub_html_exts
434+-- asks inChapter >>= guard
435+-- return (level - 1))
436+-- <|>
437437 return level
438438 Nothing -> fail "Could not retrieve header level"
439439