diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2012-01-27 01:19:20 -0800 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2012-01-27 01:19:20 -0800 |
commit | bd7918da4cd96b9f1fb06e03d1850c849b07f1b3 (patch) | |
tree | 644986dbb9bc719224e36b89b4d1912a91a17ac6 /src | |
parent | ff93a8e7891d8537c713d6d1b0fd4409c5e43ebe (diff) | |
download | pandoc-bd7918da4cd96b9f1fb06e03d1850c849b07f1b3.tar.gz |
Finished implementing --atx-headers in markdown writer.
Diffstat (limited to 'src')
-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 -> |