From b9cdef03f071b5ced19d094601a2e8cbd16748d6 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 18 Nov 2017 14:08:45 -0800 Subject: 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. --- src/Text/Pandoc/Readers/HTML.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs index 7d514e042..2f3b53a90 100644 --- a/src/Text/Pandoc/Readers/HTML.hs +++ b/src/Text/Pandoc/Readers/HTML.hs @@ -429,11 +429,11 @@ headerLevel :: PandocMonad m => Text -> TagParser m Int headerLevel tagtype = case safeRead (T.unpack (T.drop 1 tagtype)) of Just level -> - try (do - guardEnabled Ext_epub_html_exts - asks inChapter >>= guard - return (level - 1)) - <|> +-- try (do +-- guardEnabled Ext_epub_html_exts +-- asks inChapter >>= guard +-- return (level - 1)) +-- <|> return level Nothing -> fail "Could not retrieve header level" -- cgit v1.2.3