aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-09-14 11:44:11 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2019-09-14 11:44:11 -0700
commit5d1a58b3d8869302c47c6e6ebb628e0ee000c92b (patch)
treee7b549220905cde4e9a0ffdd80ebc48b8cd93443 /src/Text
parent47358831a4546b9373c0773e02f0ee7a180aa74d (diff)
downloadpandoc-5d1a58b3d8869302c47c6e6ebb628e0ee000c92b.tar.gz
Add chapter-title class to EPUB chapter title h1 elements.
See #5269.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/EPUB.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs
index c9714b0a2..f4125318b 100644
--- a/src/Text/Pandoc/Writers/EPUB.hs
+++ b/src/Text/Pandoc/Writers/EPUB.hs
@@ -522,7 +522,7 @@ pandocToEPUB version opts doc = do
toChapters [] = return []
toChapters (Div _ bs@(Header 1 _ _:_) : rest) =
toChapters (bs ++ rest)
- toChapters (Header n attr@(_,classes,_) ils : bs) = do
+ toChapters (Header n (ident,classes,kvs) ils : bs) = do
nums <- get
mbnum <- if "unnumbered" `elem` classes
then return Nothing
@@ -537,10 +537,12 @@ pandocToEPUB version opts doc = do
put nums'
return $ Just ks
let (xs,ys) = break isChapterHeader bs
- (Chapter mbnum (Header n attr ils : xs) :) `fmap` toChapters ys
+ (Chapter mbnum
+ (Header n (ident,"chapter-title":classes,kvs) ils : xs) :) <$>
+ toChapters ys
toChapters (b:bs) = do
let (xs,ys) = break isChapterHeader bs
- (Chapter Nothing (b:xs) :) `fmap` toChapters ys
+ (Chapter Nothing (b:xs) :) <$> toChapters ys
let chapters' = evalState (toChapters blocks') []