diff options
-rw-r--r-- | src/Text/Pandoc/Writers/Markdown.hs | 7 |
1 files changed, 5 insertions, 2 deletions
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 -> |