From bd7918da4cd96b9f1fb06e03d1850c849b07f1b3 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 27 Jan 2012 01:19:20 -0800 Subject: Finished implementing --atx-headers in markdown writer. --- src/Text/Pandoc/Writers/Markdown.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs index f0f608432..5be6e67b1 100644 --- a/src/Text/Pandoc/Writers/Markdown.hs +++ b/src/Text/Pandoc/Writers/Markdown.hs @@ -233,10 +233,13 @@ blockToMarkdown _ HorizontalRule = blockToMarkdown opts (Header level inlines) = do contents <- inlineListToMarkdown opts inlines st <- get + let setext = writerSetextHeaders opts return $ case level of - 1 -> contents <> cr <> text (replicate (offset contents) '=') <> + 1 | setext -> + contents <> cr <> text (replicate (offset contents) '=') <> blankline - 2 -> contents <> cr <> text (replicate (offset contents) '-') <> + 2 | setext -> + contents <> cr <> text (replicate (offset contents) '-') <> blankline -- ghc interprets '#' characters in column 1 as linenum specifiers. _ | stPlain st || writerLiterateHaskell opts -> -- cgit v1.2.3