Use isHeaderBlock from Shared rather than defining it anew...
This commit is contained in:
parent
33955fd2ef
commit
b2db6979fe
2 changed files with 3 additions and 9 deletions
|
@ -44,7 +44,7 @@ import qualified Text.XML.Light.Cursor as XC
|
|||
|
||||
import Text.Pandoc.Definition
|
||||
import Text.Pandoc.Options (WriterOptions(..), HTMLMathMethod(..), def)
|
||||
import Text.Pandoc.Shared (orderedListMarkers)
|
||||
import Text.Pandoc.Shared (orderedListMarkers, isHeaderBlock)
|
||||
import Text.Pandoc.Walk
|
||||
|
||||
-- | Data to be written at the end of the document:
|
||||
|
@ -157,9 +157,7 @@ renderSection level (ttl, body) = do
|
|||
else cMapM blockToXml body
|
||||
return $ el "section" (title ++ content)
|
||||
where
|
||||
hasSubsections = any isHeader
|
||||
isHeader (Header _ _ _) = True
|
||||
isHeader _ = False
|
||||
hasSubsections = any isHeaderBlock
|
||||
|
||||
-- | Only <p> and <empty-line> are allowed within <title> in FB2.
|
||||
formatTitle :: [Inline] -> [Content]
|
||||
|
|
|
@ -293,7 +293,7 @@ blockListToTexinfo (x:xs) = do
|
|||
case x of
|
||||
Header level _ _ -> do
|
||||
-- We need need to insert a menu for this node.
|
||||
let (before, after) = break isHeader xs
|
||||
let (before, after) = break isHeaderBlock xs
|
||||
before' <- blockListToTexinfo before
|
||||
let menu = if level < 4
|
||||
then collectNodes (level + 1) after
|
||||
|
@ -315,10 +315,6 @@ blockListToTexinfo (x:xs) = do
|
|||
xs' <- blockListToTexinfo xs
|
||||
return $ x' $$ xs'
|
||||
|
||||
isHeader :: Block -> Bool
|
||||
isHeader (Header _ _ _) = True
|
||||
isHeader _ = False
|
||||
|
||||
collectNodes :: Int -> [Block] -> [Block]
|
||||
collectNodes _ [] = []
|
||||
collectNodes level (x:xs) =
|
||||
|
|
Loading…
Add table
Reference in a new issue