aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-11-18 14:08:45 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2017-11-18 14:08:45 -0800
commitb9cdef03f071b5ced19d094601a2e8cbd16748d6 (patch)
tree4e86fd98e1ced32614fc6adcdd4a737ec5142aa0 /src/Text/Pandoc
parent9916f421dc79a17afa16cdd53c0c4803dd424907 (diff)
downloadpandoc-b9cdef03f071b5ced19d094601a2e8cbd16748d6.tar.gz
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.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Readers/HTML.hs10
1 files changed, 5 insertions, 5 deletions
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"