From 7234a79104ab8cf8358bdab153d5eefbcefc2e9a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 23 Jan 2011 08:49:19 -0800 Subject: Textile writer: Use
 instead of bc.. for code with blank lines.

This has fewer interaction effects.
---
 src/Text/Pandoc/Writers/Textile.hs | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

(limited to 'src/Text/Pandoc/Writers/Textile.hs')

diff --git a/src/Text/Pandoc/Writers/Textile.hs b/src/Text/Pandoc/Writers/Textile.hs
index cb8f20a0a..4aaee0a32 100644
--- a/src/Text/Pandoc/Writers/Textile.hs
+++ b/src/Text/Pandoc/Writers/Textile.hs
@@ -118,15 +118,18 @@ blockToTextile opts (Header level inlines) = do
   let prefix = 'h' : (show level ++ ". ")
   return $ prefix ++ contents ++ "\n"
 
+blockToTextile _ (CodeBlock (_,classes,_) str) | any (all isSpace) (lines str) =
+  return $ "\n" ++ escapeStringForXML str ++
+           "\n
\n" + where classes' = if null classes + then "" + else " class=\"" ++ unwords classes ++ "\"" + blockToTextile _ (CodeBlock (_,classes,_) str) = - return $ "bc" ++ classes' ++ dots ++ escapeStringForXML str ++ "\n" + return $ "bc" ++ classes' ++ ". " ++ escapeStringForXML str ++ "\n" where classes' = if null classes then "" else "(" ++ unwords classes ++ ")" - dots = if any isBlank (lines str) - then ".. " - else ". " - isBlank = all isSpace blockToTextile opts (BlockQuote bs@[Para _]) = do contents <- blockListToTextile opts bs -- cgit v1.2.3