@@ -2281,17 +2281,16 @@ looseItem = do
22812281resetCaption :: PandocMonad m => LP m ()
22822282resetCaption = updateState $ \st -> st{ sCaption = (Nothing, Nothing) }
22832283
2284−section :: PandocMonad m => Bool -> Attr -> Int -> LP m Blocks
2285−section starred (ident, classes, kvs) lvl = do
2284+section :: PandocMonad m => Attr -> Int -> LP m Blocks
2285+section (ident, classes, kvs) lvl = do
22862286 skipopts
22872287 contents <- grouped inline
22882288 lab <- option ident $
22892289 try (spaces >> controlSeq "label"
22902290 >> spaces >> toksToString <$> braced)
2291− let classes' = if starred then "unnumbered" : classes else classes
22922291 when (lvl == 0) $
22932292 updateState $ \st -> st{ sHasChapters = True }
2294− unless starred $ do
2293+ unless ("unnumbered" `elem` classes) $ do
22952294 hn <- sLastHeaderNum <$> getState
22962295 hasChapters <- sHasChapters <$> getState
22972296 let lvl' = lvl + if hasChapters then 1 else 0
@@ -2300,7 +2299,7 @@ section starred (ident, classes, kvs) lvl = do
23002299 updateState $ \st -> st{ sLabels = M.insert lab
23012300 [Str (renderHeaderNum num)]
23022301 (sLabels st) }
2303− attr' <- registerHeader (lab, classes', kvs) contents
2302+ attr' <- registerHeader (lab, classes, kvs) contents
23042303 return $ headerWith attr' lvl contents
23052304
23062305blockCommand :: PandocMonad m => LP m Blocks
@@ -2361,23 +2360,23 @@ blockCommands = M.fromList
23612360 -- Koma-script metadata commands
23622361 , ("dedication", mempty <$ (skipopts *> tok >>= addMeta "dedication"))
23632362 -- sectioning
2364− , ("part", section False nullAttr (-1))
2365− , ("part*", section True nullAttr (-1))
2366− , ("chapter", section False nullAttr 0)
2367− , ("chapter*", section True ("",["unnumbered"],[]) 0)
2368− , ("section", section False nullAttr 1)
2369− , ("section*", section True ("",["unnumbered"],[]) 1)
2370− , ("subsection", section False nullAttr 2)
2371− , ("subsection*", section True ("",["unnumbered"],[]) 2)
2372− , ("subsubsection", section False nullAttr 3)
2373− , ("subsubsection*", section True ("",["unnumbered"],[]) 3)
2374− , ("paragraph", section False nullAttr 4)
2375− , ("paragraph*", section True ("",["unnumbered"],[]) 4)
2376− , ("subparagraph", section False nullAttr 5)
2377− , ("subparagraph*", section True ("",["unnumbered"],[]) 5)
2363+ , ("part", section nullAttr (-1))
2364+ , ("part*", section nullAttr (-1))
2365+ , ("chapter", section nullAttr 0)
2366+ , ("chapter*", section ("",["unnumbered"],[]) 0)
2367+ , ("section", section nullAttr 1)
2368+ , ("section*", section ("",["unnumbered"],[]) 1)
2369+ , ("subsection", section nullAttr 2)
2370+ , ("subsection*", section ("",["unnumbered"],[]) 2)
2371+ , ("subsubsection", section nullAttr 3)
2372+ , ("subsubsection*", section ("",["unnumbered"],[]) 3)
2373+ , ("paragraph", section nullAttr 4)
2374+ , ("paragraph*", section ("",["unnumbered"],[]) 4)
2375+ , ("subparagraph", section nullAttr 5)
2376+ , ("subparagraph*", section ("",["unnumbered"],[]) 5)
23782377 -- beamer slides
2379− , ("frametitle", section False nullAttr 3)
2380− , ("framesubtitle", section False nullAttr 4)
2378+ , ("frametitle", section nullAttr 3)
2379+ , ("framesubtitle", section nullAttr 4)
23812380 -- letters
23822381 , ("opening", (para . trimInlines) <$> (skipopts *> tok))
23832382 , ("closing", skipopts *> closing)