diff options
author | Clare Macrae <github@cfmacrae.fastmail.co.uk> | 2014-07-01 22:10:08 +0100 |
---|---|---|
committer | Clare Macrae <github@cfmacrae.fastmail.co.uk> | 2014-07-01 22:10:08 +0100 |
commit | 3cb76d956028c4c529dc95aab8cc4dce93f8e886 (patch) | |
tree | 58f5d31b79db338d8646ee9d2e26fa6801193eba /man/make-pandoc-man-pages.hs | |
parent | 244c4eee7487e386e3e6ff7cf78146385eef9d1f (diff) | |
parent | 264e366f1a973efa56fc32079927fc51cc1936ca (diff) |
Merge branch 'master' of git://github.com/jgm/pandoc into dokuwiki
Diffstat (limited to 'man/make-pandoc-man-pages.hs')
-rw-r--r-- | man/make-pandoc-man-pages.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/man/make-pandoc-man-pages.hs b/man/make-pandoc-man-pages.hs index 008294433..afba9135a 100644 --- a/man/make-pandoc-man-pages.hs +++ b/man/make-pandoc-man-pages.hs @@ -27,7 +27,7 @@ main = do unless (null ds1 && null ds2) $ do rmContents <- UTF8.readFile "README" - let (Pandoc meta blocks) = readMarkdown def rmContents + let (Pandoc meta blocks) = normalize $ readMarkdown def rmContents let manBlocks = removeSect [Str "Wrappers"] $ removeSect [Str "Pandoc's",Space,Str "markdown"] blocks let syntaxBlocks = extractSect [Str "Pandoc's",Space,Str "markdown"] blocks @@ -67,13 +67,13 @@ 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) | x == 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) | z == ils = bottomUp promoteHeader $ takeWhile (not . isHeader1) xs where promoteHeader (Header n attr x) = Header (n-1) attr x promoteHeader x = x |