git.iko.soy/typeable/pandoc
on master help sign in
ConTeXt writer: Made \start/stoptyping flush with margin.

This prevents extra blank lines.

commit71736869bb6a3ff50505883fe3d98af07f7b114d authorJohn MacFarlane <jgm@berkeley.edu> dateTue 19 Jul 2011, 16:29 (15 years ago) parent8fd3d0b
2 files changed+5−5
src/Text/Pandoc/Writers/ConTeXt.hs+1−1 tests/writer.context+4−4
src/Text/Pandoc/Writers/ConTeXt.hs+1−1
@@ -123,7 +123,7 @@ blockToConTeXt (BlockQuote lst) = do
123123 contents <- blockListToConTeXt lst
124124 return $ "\\startblockquote" $$ nest 0 contents $$ "\\stopblockquote" <> blankline
125125blockToConTeXt (CodeBlock _ str) =
126− return $ "\\starttyping" <> cr <> flush (text str) <> cr <> "\\stoptyping" $$ blankline
126+ return $ flush ("\\starttyping" <> cr <> text str <> cr <> "\\stoptyping") $$ blankline
127127 -- blankline because \stoptyping can't have anything after it, inc. '}'
128128blockToConTeXt (RawBlock "context" str) = return $ text str <> blankline
129129blockToConTeXt (RawBlock _ _ ) = return empty
tests/writer.context+4−4
@@ -490,9 +490,9 @@ Multiple blocks with italics:
490490\startdescr{{\em orange}}
491491 orange fruit
492492
493− \starttyping
493+\starttyping
494494{ orange code block }
495− \stoptyping
495+\stoptyping
496496
497497 \startblockquote
498498 orange block quote
@@ -866,9 +866,9 @@ Here is a footnote reference,\footnote{Here is the footnote. It can go
866866 Subsequent blocks are indented to show that they belong to the footnote (as
867867 with list items).
868868
869− \starttyping
869+\starttyping
870870 { <code> }
871− \stoptyping
871+\stoptyping
872872
873873 If you want, you can indent every line, but you can also be lazy and just
874874 indent the first line of each block.} This should {\em not} be a footnote