aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2012-02-08 08:40:53 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2012-02-08 08:40:53 -0800
commit64304a2165fa9600cdab1a7e00fd8faa6047e8c4 (patch)
tree65a31e53202ce2d806d96ba169c711ebbd59ad69
parent142c29d90827f81bcccad35ed39f3669298b8961 (diff)
downloadpandoc-64304a2165fa9600cdab1a7e00fd8faa6047e8c4.tar.gz
Don't wrap headers in markdown or rst.
-rw-r--r--src/Text/Pandoc/Writers/Markdown.hs3
-rw-r--r--src/Text/Pandoc/Writers/RST.hs2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs
index 8473f8ca4..7ce939395 100644
--- a/src/Text/Pandoc/Writers/Markdown.hs
+++ b/src/Text/Pandoc/Writers/Markdown.hs
@@ -234,7 +234,8 @@ blockToMarkdown opts (Header level inlines) = do
contents <- inlineListToMarkdown opts inlines
st <- get
let setext = writerSetextHeaders opts
- return $ case level of
+ return $ nowrap
+ $ case level of
1 | setext ->
contents <> cr <> text (replicate (offset contents) '=') <>
blankline
diff --git a/src/Text/Pandoc/Writers/RST.hs b/src/Text/Pandoc/Writers/RST.hs
index db2ad0dfb..d6e5b5c9e 100644
--- a/src/Text/Pandoc/Writers/RST.hs
+++ b/src/Text/Pandoc/Writers/RST.hs
@@ -157,7 +157,7 @@ blockToRST (Header level inlines) = do
contents <- inlineListToRST inlines
let headerChar = if level > 5 then ' ' else "=-~^'" !! (level - 1)
let border = text $ replicate (offset contents) headerChar
- return $ contents $$ border $$ blankline
+ return $ nowrap $ contents $$ border $$ blankline
blockToRST (CodeBlock (_,classes,_) str) = do
opts <- stOptions <$> get
let tabstop = writerTabStop opts