From d599c4cdabd0d71fd9d27161c949b5e1e692436d Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 29 Oct 2012 22:45:52 -0700 Subject: Added Attr field to Header. Previously header ids were autogenerated by the writers. Now they are generated (unless supplied explicitly) in the markdown parser, if the `header_identifiers` extension is selected. In addition, the textile reader now supports id attributes on headers. --- man/make-pandoc-man-pages.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'man') diff --git a/man/make-pandoc-man-pages.hs b/man/make-pandoc-man-pages.hs index 31a935a28..52e2741f1 100644 --- a/man/make-pandoc-man-pages.hs +++ b/man/make-pandoc-man-pages.hs @@ -55,7 +55,7 @@ removeLinks (Link l _) = l removeLinks x = [x] capitalizeHeaders :: Block -> Block -capitalizeHeaders (Header 1 xs) = Header 1 $ bottomUp capitalize xs +capitalizeHeaders (Header 1 attr xs) = Header 1 attr $ bottomUp capitalize xs capitalizeHeaders x = x capitalize :: Inline -> Inline @@ -63,22 +63,22 @@ capitalize (Str xs) = Str $ map toUpper xs capitalize x = x removeSect :: [Inline] -> [Block] -> [Block] -removeSect ils (Header 1 x:xs) | normalize x == normalize ils = +removeSect ils (Header 1 _ x:xs) | normalize x == normalize ils = dropWhile (not . isHeader1) xs removeSect ils (x:xs) = x : removeSect ils xs removeSect _ [] = [] extractSect :: [Inline] -> [Block] -> [Block] -extractSect ils (Header 1 z:xs) | normalize z == normalize ils = +extractSect ils (Header 1 _ z:xs) | normalize z == normalize ils = bottomUp promoteHeader $ takeWhile (not . isHeader1) xs - where promoteHeader (Header n x) = Header (n-1) x + where promoteHeader (Header n attr x) = Header (n-1) attr x promoteHeader x = x extractSect ils (x:xs) = extractSect ils xs extractSect _ [] = [] isHeader1 :: Block -> Bool -isHeader1 (Header 1 _) = True -isHeader1 _ = False +isHeader1 (Header 1 _ _ ) = True +isHeader1 _ = False -- | Returns a list of 'dependencies' that have been modified after 'file'. -- cgit v1.2.3