summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2011-07-19 16:29:33 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2011-07-19 16:29:33 -0700
commit71736869bb6a3ff50505883fe3d98af07f7b114d (patch)
tree6a5aa8573ab4f0253bff7883a4406725f1e3ec57
parent8fd3d0bdbbd8ba8c681c72a401c517797c2ecd0e (diff)
ConTeXt writer: Made \start/stoptyping flush with margin.
This prevents extra blank lines.
-rw-r--r--src/Text/Pandoc/Writers/ConTeXt.hs2
-rw-r--r--tests/writer.context8
2 files changed, 5 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Writers/ConTeXt.hs b/src/Text/Pandoc/Writers/ConTeXt.hs
index 378c4ce96..763f77d7c 100644
--- a/src/Text/Pandoc/Writers/ConTeXt.hs
+++ b/src/Text/Pandoc/Writers/ConTeXt.hs
@@ -123,7 +123,7 @@ blockToConTeXt (BlockQuote lst) = do
contents <- blockListToConTeXt lst
return $ "\\startblockquote" $$ nest 0 contents $$ "\\stopblockquote" <> blankline
blockToConTeXt (CodeBlock _ str) =
- return $ "\\starttyping" <> cr <> flush (text str) <> cr <> "\\stoptyping" $$ blankline
+ return $ flush ("\\starttyping" <> cr <> text str <> cr <> "\\stoptyping") $$ blankline
-- blankline because \stoptyping can't have anything after it, inc. '}'
blockToConTeXt (RawBlock "context" str) = return $ text str <> blankline
blockToConTeXt (RawBlock _ _ ) = return empty
diff --git a/tests/writer.context b/tests/writer.context
index f9fb03cef..9c3221c31 100644
--- a/tests/writer.context
+++ b/tests/writer.context
@@ -490,9 +490,9 @@ Multiple blocks with italics:
\startdescr{{\em orange}}
orange fruit
- \starttyping
+\starttyping
{ orange code block }
- \stoptyping
+\stoptyping
\startblockquote
orange block quote
@@ -866,9 +866,9 @@ Here is a footnote reference,\footnote{Here is the footnote. It can go
Subsequent blocks are indented to show that they belong to the footnote (as
with list items).
- \starttyping
+\starttyping
{ <code> }
- \stoptyping
+\stoptyping
If you want, you can indent every line, but you can also be lazy and just
indent the first line of each block.} This should {\em not} be a footnote