diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-11-23 21:29:21 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-11-23 21:29:21 -0800 |
commit | b20ecbedc4e09a40aa42fe4e505c0cd097f23ee7 (patch) | |
tree | 2d72b6d570b97a80552799ff03300071ba13b00e /src/Text | |
parent | 4361dc0245a65d4f24f2df062684cdb1a0c3bc5a (diff) | |
download | pandoc-b20ecbedc4e09a40aa42fe4e505c0cd097f23ee7.tar.gz |
AsciiDoc writer: Fixed code blocks.
Closes #1861.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Writers/AsciiDoc.hs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/Text/Pandoc/Writers/AsciiDoc.hs b/src/Text/Pandoc/Writers/AsciiDoc.hs index 174b00dac..f42f84432 100644 --- a/src/Text/Pandoc/Writers/AsciiDoc.hs +++ b/src/Text/Pandoc/Writers/AsciiDoc.hs @@ -160,13 +160,12 @@ blockToAsciiDoc opts (Header level (ident,_,_) inlines) = do _ -> empty) <> blankline else identifier $$ text (replicate level '=') <> space <> contents <> blankline) -blockToAsciiDoc _ (CodeBlock (_,classes,_) str) = return $ - flush (attrs <> dashes <> space <> attrs <> cr <> text str <> - cr <> dashes) <> blankline - where dashes = text $ replicate (maximum $ map length $ lines str) '-' - attrs = if null classes - then empty - else text $ intercalate "," $ "code" : classes +blockToAsciiDoc _ (CodeBlock (_,classes,_) str) = return $ (flush $ + if null classes + then "...." $$ text str $$ "...." + else attrs $$ "----" $$ text str $$ "----") + <> blankline + where attrs = "[" <> text (intercalate "," ("source" : classes)) <> "]" blockToAsciiDoc opts (BlockQuote blocks) = do contents <- blockListToAsciiDoc opts blocks let isBlock (BlockQuote _) = True |