diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2011-12-27 15:45:34 -0800 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2011-12-27 15:45:34 -0800 |
commit | a579e2c89289b97fa4083c2c0e2299da9d44e9e0 (patch) | |
tree | 11976af7a06a442133f58baf70cff7c1445ec9f8 /src/Text | |
parent | 8838f473a825747fc00f61cbddfe3732fe3a9b6f (diff) | |
download | pandoc-a579e2c89289b97fa4083c2c0e2299da9d44e9e0.tar.gz |
Replaced Apostrophe, Ellipses, EmDash, EnDash w/ unicode strings.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Parsing.hs | 12 | ||||
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 6 | ||||
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 14 | ||||
-rw-r--r-- | src/Text/Pandoc/Shared.hs | 4 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/AsciiDoc.hs | 4 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/ConTeXt.hs | 8 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/Docbook.hs | 4 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 4 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/LaTeX.hs | 13 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/Man.hs | 12 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/Markdown.hs | 4 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/MediaWiki.hs | 12 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/OpenDocument.hs | 8 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/Org.hs | 11 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/RST.hs | 4 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/RTF.hs | 14 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/Texinfo.hs | 8 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/Textile.hs | 30 |
18 files changed, 67 insertions, 105 deletions
diff --git a/src/Text/Pandoc/Parsing.hs b/src/Text/Pandoc/Parsing.hs index 78642b074..5fa375ca6 100644 --- a/src/Text/Pandoc/Parsing.hs +++ b/src/Text/Pandoc/Parsing.hs @@ -779,22 +779,22 @@ doubleQuoteEnd = do ellipses :: GenParser Char st Inline ellipses = do - try (charOrRef "…\133") <|> try (string "..." >> return '…') - return Ellipses + try (charOrRef "\8230\133") <|> try (string "..." >> return '…') + return (Str "\8230") dash :: GenParser Char st Inline dash = enDash <|> emDash enDash :: GenParser Char st Inline enDash = do - try (charOrRef "–\150") <|> + try (charOrRef "\8211\150") <|> try (char '-' >> lookAhead (satisfy isDigit) >> return '–') - return EnDash + return (Str "\8211") emDash :: GenParser Char st Inline emDash = do - try (charOrRef "—\151") <|> (try $ string "--" >> optional (char '-') >> return '—') - return EmDash + try (charOrRef "\8212\151") <|> (try $ string "--" >> optional (char '-') >> return '-') + return (Str "\8212") -- -- Macros diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index c418fef2a..708aa58c1 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -802,13 +802,13 @@ ellipses = try $ do optional $ char 'l' string "dots" optional $ try $ string "{}" - return Ellipses + return (Str "…") enDash :: GenParser Char st Inline -enDash = try (string "--") >> return EnDash +enDash = try (string "--") >> return (Str "-") emDash :: GenParser Char st Inline -emDash = try (string "---") >> return EmDash +emDash = try (string "---") >> return (Str "—") hyphen :: GenParser Char st Inline hyphen = char '-' >> return (Str "-") diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 96b2d4315..db68df629 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -1087,20 +1087,18 @@ nonEndline = satisfy (/='\n') str :: GenParser Char ParserState Inline str = do - st <- getState + smart <- stateSmart `fmap` getState a <- alphaNum as <- many $ alphaNum <|> (try $ char '_' >>~ lookAhead alphaNum) - <|> if stateStrict st - then mzero - else (try $ satisfy (\c -> c == '\'' || c == '\x2019') >> + <|> if smart + then (try $ satisfy (\c -> c == '\'' || c == '\x2019') >> lookAhead alphaNum >> return '\x2019') - -- for things like l'aide - would be better to return - -- an Apostrophe, but we can't in this context + -- for things like l'aide + else mzero let result = a:as - state <- getState let spacesToNbr = map (\c -> if c == ' ' then '\160' else c) - if stateSmart state + if smart then case likelyAbbrev result of [] -> return $ Str result xs -> choice (map (\x -> diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs index fac965b89..301848d6e 100644 --- a/src/Text/Pandoc/Shared.hs +++ b/src/Text/Pandoc/Shared.hs @@ -325,10 +325,6 @@ stringify = queryWith go go (Str x) = x go (Code _ x) = x go (Math _ x) = x - go EmDash = "--" - go EnDash = "-" - go Apostrophe = "'" - go Ellipses = "..." go LineBreak = " " go _ = "" diff --git a/src/Text/Pandoc/Writers/AsciiDoc.hs b/src/Text/Pandoc/Writers/AsciiDoc.hs index f45c20e9e..1913eb92b 100644 --- a/src/Text/Pandoc/Writers/AsciiDoc.hs +++ b/src/Text/Pandoc/Writers/AsciiDoc.hs @@ -321,10 +321,6 @@ inlineToAsciiDoc opts (Quoted SingleQuote lst) = do inlineToAsciiDoc opts (Quoted DoubleQuote lst) = do contents <- inlineListToAsciiDoc opts lst return $ "``" <> contents <> "''" -inlineToAsciiDoc _ EmDash = return "\8212" -inlineToAsciiDoc _ EnDash = return "\8211" -inlineToAsciiDoc _ Apostrophe = return "\8217" -inlineToAsciiDoc _ Ellipses = return "\8230" inlineToAsciiDoc _ (Code _ str) = return $ text "`" <> text (escapeStringUsing (backslashEscapes "`") str) <> "`" inlineToAsciiDoc _ (Str str) = return $ text $ escapeString str diff --git a/src/Text/Pandoc/Writers/ConTeXt.hs b/src/Text/Pandoc/Writers/ConTeXt.hs index b59b71cf0..a6771437d 100644 --- a/src/Text/Pandoc/Writers/ConTeXt.hs +++ b/src/Text/Pandoc/Writers/ConTeXt.hs @@ -102,6 +102,10 @@ escapeCharForConTeXt ch = ']' -> "{]}" '_' -> "\\letterunderscore{}" '\160' -> "~" + '\x2014' -> "---" + '\x2013' -> "--" + '\x2019' -> "'" + '\x2026' -> "\\ldots{}" x -> [x] -- | Escape string for ConTeXt @@ -258,10 +262,6 @@ inlineToConTeXt (Quoted DoubleQuote lst) = do contents <- inlineListToConTeXt lst return $ "\\quotation" <> braces contents inlineToConTeXt (Cite _ lst) = inlineListToConTeXt lst -inlineToConTeXt Apostrophe = return $ char '\'' -inlineToConTeXt EmDash = return "---" -inlineToConTeXt EnDash = return "--" -inlineToConTeXt Ellipses = return "\\ldots{}" inlineToConTeXt (Str str) = return $ text $ stringToConTeXt str inlineToConTeXt (Math InlineMath str) = return $ char '$' <> text str <> char '$' diff --git a/src/Text/Pandoc/Writers/Docbook.hs b/src/Text/Pandoc/Writers/Docbook.hs index 150033f3f..f3ac726a9 100644 --- a/src/Text/Pandoc/Writers/Docbook.hs +++ b/src/Text/Pandoc/Writers/Docbook.hs @@ -248,10 +248,6 @@ inlineToDocbook opts (Quoted _ lst) = inTagsSimple "quote" $ inlinesToDocbook opts lst inlineToDocbook opts (Cite _ lst) = inlinesToDocbook opts lst -inlineToDocbook _ Apostrophe = char '\'' -inlineToDocbook _ Ellipses = text "…" -inlineToDocbook _ EmDash = text "—" -inlineToDocbook _ EnDash = text "–" inlineToDocbook _ (Code _ str) = inTagsSimple "literal" $ text (escapeStringForXML str) inlineToDocbook opts (Math _ str) = inlinesToDocbook opts $ readTeXMath str diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 1cee2b8e6..e3ade3c9e 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -540,10 +540,6 @@ inlineToHtml opts inline = (Str str) -> return $ strToHtml str (Space) -> return $ strToHtml " " (LineBreak) -> return H.br - (EmDash) -> return $ strToHtml "—" - (EnDash) -> return $ strToHtml "–" - (Ellipses) -> return $ strToHtml "…" - (Apostrophe) -> return $ strToHtml "’" (Emph lst) -> inlineListToHtml opts lst >>= return . H.em (Strong lst) -> inlineListToHtml opts lst >>= return . H.strong (Code attr str) -> case highlight formatHtmlInline attr str of diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index 117ecca51..dd11cd2fe 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -162,6 +162,8 @@ stringToLaTeX isUrl = escapeStringUsing latexEscapes , ('\x201C', "``") , ('\x201D', "''") , ('\x2026', "\\ldots{}") + , ('\x2014', "---") + , ('\x2013', "--") ] -- | Puts contents into LaTeX command. @@ -201,8 +203,8 @@ blockToLaTeX (CodeBlock (_,classes,keyvalAttr) str) = do then modify (\s -> s{ stVerbInNote = True }) >> return "Verbatim" else return "verbatim" - return $ flush (text $ "\\begin{" ++ env ++ "}") $$ text str $$ - text ("\\end{" ++ env ++ "}") $$ cr -- final cr because of notes + return $ flush (text ("\\begin{" ++ env ++ "}") $$ text str $$ + text ("\\end{" ++ env ++ "}")) $$ cr -- final cr because of notes listingsCodeBlock = do st <- get let params = if writerListings (stOptions st) @@ -236,7 +238,7 @@ blockToLaTeX (CodeBlock (_,classes,keyvalAttr) str) = do case highlight formatLaTeXBlock ("",classes,keyvalAttr) str of Nothing -> rawCodeBlock Just h -> modify (\st -> st{ stHighlighting = True }) >> - return (text h) + return (flush $ text h) blockToLaTeX (RawBlock "latex" x) = return $ text x <> blankline blockToLaTeX (RawBlock _ _) = return empty blockToLaTeX (BulletList lst) = do @@ -365,7 +367,6 @@ inlineListToLaTeX lst = mapM inlineToLaTeX lst >>= return . hcat isQuoted :: Inline -> Bool isQuoted (Quoted _ _) = True -isQuoted Apostrophe = True isQuoted _ = False -- | Convert inline element to LaTeX @@ -441,10 +442,6 @@ inlineToLaTeX (Quoted DoubleQuote lst) = do then "\\," else empty return $ "``" <> s1 <> contents <> s2 <> "''" -inlineToLaTeX Apostrophe = return $ char '\'' -inlineToLaTeX EmDash = return "---" -inlineToLaTeX EnDash = return "--" -inlineToLaTeX Ellipses = return "\\ldots{}" inlineToLaTeX (Str str) = return $ text $ stringToLaTeX False str inlineToLaTeX (Math InlineMath str) = return $ char '$' <> text str <> char '$' inlineToLaTeX (Math DisplayMath str) = return $ "\\[" <> text str <> "\\]" diff --git a/src/Text/Pandoc/Writers/Man.hs b/src/Text/Pandoc/Writers/Man.hs index 78b9274d6..d3735efa7 100644 --- a/src/Text/Pandoc/Writers/Man.hs +++ b/src/Text/Pandoc/Writers/Man.hs @@ -98,7 +98,13 @@ noteToMan opts num note = do -- | Association list of characters to escape. manEscapes :: [(Char, String)] -manEscapes = [('\160', "\\ "), ('\'', "\\[aq]")] ++ backslashEscapes "@\\" +manEscapes = [ ('\160', "\\ ") + , ('\'', "\\[aq]") + , ('’', "'") + , ('\x2014', "\\[em]") + , ('\x2013', "\\[en]") + , ('\x2026', "\\&...") + ] ++ backslashEscapes "@\\" -- | Escape special characters for Man. escapeString :: String -> String @@ -303,10 +309,6 @@ inlineToMan opts (Quoted DoubleQuote lst) = do return $ text "\\[lq]" <> contents <> text "\\[rq]" inlineToMan opts (Cite _ lst) = inlineListToMan opts lst -inlineToMan _ EmDash = return $ text "\\[em]" -inlineToMan _ EnDash = return $ text "\\[en]" -inlineToMan _ Apostrophe = return $ char '\'' -inlineToMan _ Ellipses = return $ text "\\&..." inlineToMan _ (Code _ str) = return $ text $ "\\f[C]" ++ escapeCode str ++ "\\f[]" inlineToMan _ (Str str) = return $ text $ escapeString str diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs index 70202294f..f0f608432 100644 --- a/src/Text/Pandoc/Writers/Markdown.hs +++ b/src/Text/Pandoc/Writers/Markdown.hs @@ -432,10 +432,6 @@ inlineToMarkdown opts (Quoted SingleQuote lst) = do inlineToMarkdown opts (Quoted DoubleQuote lst) = do contents <- inlineListToMarkdown opts lst return $ "“" <> contents <> "”" -inlineToMarkdown _ EmDash = return "\8212" -inlineToMarkdown _ EnDash = return "\8211" -inlineToMarkdown _ Apostrophe = return "\8217" -inlineToMarkdown _ Ellipses = return "\8230" inlineToMarkdown opts (Code attr str) = let tickGroups = filter (\s -> '`' `elem` s) $ group str longest = if null tickGroups diff --git a/src/Text/Pandoc/Writers/MediaWiki.hs b/src/Text/Pandoc/Writers/MediaWiki.hs index a7c7fc482..f31a2c2d1 100644 --- a/src/Text/Pandoc/Writers/MediaWiki.hs +++ b/src/Text/Pandoc/Writers/MediaWiki.hs @@ -346,22 +346,14 @@ inlineToMediaWiki opts (SmallCaps lst) = inlineListToMediaWiki opts lst inlineToMediaWiki opts (Quoted SingleQuote lst) = do contents <- inlineListToMediaWiki opts lst - return $ "‘" ++ contents ++ "’" + return $ "\8216" ++ contents ++ "\8217" inlineToMediaWiki opts (Quoted DoubleQuote lst) = do contents <- inlineListToMediaWiki opts lst - return $ "“" ++ contents ++ "”" + return $ "\8220" ++ contents ++ "\8221" inlineToMediaWiki opts (Cite _ lst) = inlineListToMediaWiki opts lst -inlineToMediaWiki _ EmDash = return "—" - -inlineToMediaWiki _ EnDash = return "–" - -inlineToMediaWiki _ Apostrophe = return "’" - -inlineToMediaWiki _ Ellipses = return "…" - inlineToMediaWiki _ (Code _ str) = return $ "<tt>" ++ (escapeString str) ++ "</tt>" diff --git a/src/Text/Pandoc/Writers/OpenDocument.hs b/src/Text/Pandoc/Writers/OpenDocument.hs index e675f4e65..23ef2e31d 100644 --- a/src/Text/Pandoc/Writers/OpenDocument.hs +++ b/src/Text/Pandoc/Writers/OpenDocument.hs @@ -154,8 +154,8 @@ inHeaderTags i d = , ("text:outline-level", show i)] d inQuotes :: QuoteType -> Doc -> Doc -inQuotes SingleQuote s = text "‘" <> s <> text "’" -inQuotes DoubleQuote s = text "“" <> s <> text "”" +inQuotes SingleQuote s = char '\8216' <> s <> char '\8217' +inQuotes DoubleQuote s = char '\8220' <> s <> char '\8221' handleSpaces :: String -> Doc handleSpaces s @@ -361,10 +361,6 @@ inlinesToOpenDocument o l = hcat <$> mapM (inlineToOpenDocument o) l -- | Convert an inline element to OpenDocument. inlineToOpenDocument :: WriterOptions -> Inline -> State WriterState Doc inlineToOpenDocument o ils - | Ellipses <- ils = inTextStyle $ text "…" - | EmDash <- ils = inTextStyle $ text "—" - | EnDash <- ils = inTextStyle $ text "–" - | Apostrophe <- ils = inTextStyle $ text "’" | Space <- ils = inTextStyle space | LineBreak <- ils = return $ selfClosingTag "text:line-break" [] | Str s <- ils = inTextStyle $ handleSpaces $ escapeStringForXML s diff --git a/src/Text/Pandoc/Writers/Org.hs b/src/Text/Pandoc/Writers/Org.hs index 6e0fb98e1..4c77ba7c6 100644 --- a/src/Text/Pandoc/Writers/Org.hs +++ b/src/Text/Pandoc/Writers/Org.hs @@ -95,7 +95,12 @@ noteToOrg num note = do -- | Escape special characters for Org. escapeString :: String -> String -escapeString = escapeStringUsing (backslashEscapes "^_") +escapeString = escapeStringUsing $ + [ ('\x2014',"---") + , ('\x2013',"--") + , ('\x2019',"'") + , ('\x2026',"...") + ] ++ backslashEscapes "^_" titleToOrg :: [Inline] -> State WriterState Doc titleToOrg [] = return empty @@ -249,10 +254,6 @@ inlineToOrg (Quoted DoubleQuote lst) = do contents <- inlineListToOrg lst return $ "\"" <> contents <> "\"" inlineToOrg (Cite _ lst) = inlineListToOrg lst -inlineToOrg EmDash = return "---" -inlineToOrg EnDash = return "--" -inlineToOrg Apostrophe = return "'" -inlineToOrg Ellipses = return "..." inlineToOrg (Code _ str) = return $ "=" <> text str <> "=" inlineToOrg (Str str) = return $ text $ escapeString str inlineToOrg (Math t str) = do diff --git a/src/Text/Pandoc/Writers/RST.hs b/src/Text/Pandoc/Writers/RST.hs index 0f0479e16..125ed4f13 100644 --- a/src/Text/Pandoc/Writers/RST.hs +++ b/src/Text/Pandoc/Writers/RST.hs @@ -281,10 +281,6 @@ inlineToRST (Quoted DoubleQuote lst) = do return $ "“" <> contents <> "”" inlineToRST (Cite _ lst) = inlineListToRST lst -inlineToRST EmDash = return $ char '\8212' -inlineToRST EnDash = return $ char '\8211' -inlineToRST Apostrophe = return $ char '\8217' -inlineToRST Ellipses = return $ char '\8230' inlineToRST (Code _ str) = return $ "``" <> text str <> "``" inlineToRST (Str str) = return $ text $ escapeString str inlineToRST (Math t str) = do diff --git a/src/Text/Pandoc/Writers/RTF.hs b/src/Text/Pandoc/Writers/RTF.hs index eb36c1ca6..4e7c2a7cd 100644 --- a/src/Text/Pandoc/Writers/RTF.hs +++ b/src/Text/Pandoc/Writers/RTF.hs @@ -106,7 +106,15 @@ handleUnicode (c:cs) = -- | Escape special characters. escapeSpecial :: String -> String -escapeSpecial = escapeStringUsing (('\t',"\\tab "):(backslashEscapes "{\\}")) +escapeSpecial = escapeStringUsing $ + [ ('\t',"\\tab ") + , ('\8216',"\\u8216'") + , ('\8217',"\\u8217'") + , ('\8220',"\\u8220\"") + , ('\8221',"\\u8221\"") + , ('\8211',"\\u8211-") + , ('\8212',"\\u8212-") + ] ++ backslashEscapes "{\\}" -- | Escape strings as needed for rich text format. stringToRTF :: String -> String @@ -287,10 +295,6 @@ inlineToRTF (Quoted SingleQuote lst) = "\\u8216'" ++ (inlineListToRTF lst) ++ "\\u8217'" inlineToRTF (Quoted DoubleQuote lst) = "\\u8220\"" ++ (inlineListToRTF lst) ++ "\\u8221\"" -inlineToRTF Apostrophe = "\\u8217'" -inlineToRTF Ellipses = "\\u8230?" -inlineToRTF EmDash = "\\u8212-" -inlineToRTF EnDash = "\\u8211-" inlineToRTF (Code _ str) = "{\\f1 " ++ (codeStringToRTF str) ++ "}" inlineToRTF (Str str) = stringToRTF str inlineToRTF (Math _ str) = inlineListToRTF $ readTeXMath str diff --git a/src/Text/Pandoc/Writers/Texinfo.hs b/src/Text/Pandoc/Writers/Texinfo.hs index 4f6645cd5..563ad7044 100644 --- a/src/Text/Pandoc/Writers/Texinfo.hs +++ b/src/Text/Pandoc/Writers/Texinfo.hs @@ -96,6 +96,10 @@ stringToTexinfo = escapeStringUsing texinfoEscapes , ('@', "@@") , (',', "@comma{}") -- only needed in argument lists , ('\160', "@ ") + , ('\x2014', "---") + , ('\x2013', "--") + , ('\x2026', "@dots{}") + , ('\x2019', "'") ] -- | Puts contents into Texinfo command. @@ -387,10 +391,6 @@ inlineToTexinfo (Quoted DoubleQuote lst) = do inlineToTexinfo (Cite _ lst) = inlineListToTexinfo lst -inlineToTexinfo Apostrophe = return $ char '\'' -inlineToTexinfo EmDash = return $ text "---" -inlineToTexinfo EnDash = return $ text "--" -inlineToTexinfo Ellipses = return $ text "@dots{}" inlineToTexinfo (Str str) = return $ text (stringToTexinfo str) inlineToTexinfo (Math _ str) = return $ inCmd "math" $ text str inlineToTexinfo (RawInline f str) | f == "latex" || f == "tex" = diff --git a/src/Text/Pandoc/Writers/Textile.hs b/src/Text/Pandoc/Writers/Textile.hs index 6614ec28e..26d5ec6d7 100644 --- a/src/Text/Pandoc/Writers/Textile.hs +++ b/src/Text/Pandoc/Writers/Textile.hs @@ -72,15 +72,19 @@ withUseTags action = do -- | Escape one character as needed for Textile. escapeCharForTextile :: Char -> String escapeCharForTextile x = case x of - '&' -> "&" - '<' -> "<" - '>' -> ">" - '"' -> """ - '*' -> "*" - '_' -> "_" - '@' -> "@" - '|' -> "|" - c -> [c] + '&' -> "&" + '<' -> "<" + '>' -> ">" + '"' -> """ + '*' -> "*" + '_' -> "_" + '@' -> "@" + '|' -> "|" + '\x2014' -> " -- " + '\x2013' -> " - " + '\x2019' -> "'" + '\x2026' -> "..." + c -> [c] -- | Escape string as needed for Textile. escapeStringForTextile :: String -> String @@ -370,14 +374,6 @@ inlineToTextile opts (Quoted DoubleQuote lst) = do inlineToTextile opts (Cite _ lst) = inlineListToTextile opts lst -inlineToTextile _ EmDash = return " -- " - -inlineToTextile _ EnDash = return " - " - -inlineToTextile _ Apostrophe = return "'" - -inlineToTextile _ Ellipses = return "..." - inlineToTextile _ (Code _ str) = return $ if '@' `elem` str then "<tt>" ++ escapeStringForXML str ++ "</tt>" |