aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/Textile.hs20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Textile.hs b/src/Text/Pandoc/Readers/Textile.hs
index f33436835..35c134b13 100644
--- a/src/Text/Pandoc/Readers/Textile.hs
+++ b/src/Text/Pandoc/Readers/Textile.hs
@@ -78,7 +78,7 @@ readTextile state s =
-- | Special chars border strings parsing
specialChars :: [Char]
-specialChars = "\\[]<>*#_@~-+^&,.;:!?|\"'%()"
+specialChars = "\\[]<>*#_@~-+^&,.;:!?|\"'%()="
-- | Generate a Pandoc ADT from a textile document
parseTextile :: GenParser Char ParserState Pandoc
@@ -370,6 +370,7 @@ inlineParsers = [ autoLink
, whitespace
, endline
, code
+ , escapedInline
, htmlSpan
, rawHtmlInline
, note
@@ -486,6 +487,23 @@ image = try $ do
char '!'
return $ Image [Str alt] (src, alt)
+escapedInline :: GenParser Char ParserState Inline
+escapedInline = escapedEqs <|> escapedTag
+
+-- | literal text escaped between == ... ==
+escapedEqs :: GenParser Char ParserState Inline
+escapedEqs = try $ do
+ string "=="
+ contents <- manyTill anyChar (try $ string "==")
+ return $ Str contents
+
+-- | literal text escaped btw <notextile> tags
+escapedTag :: GenParser Char ParserState Inline
+escapedTag = try $ do
+ string "<notextile>"
+ contents <- manyTill anyChar (try $ string "</notextile>")
+ return $ Str contents
+
-- | Any special symbol defined in specialChars
symbol :: GenParser Char ParserState Inline
symbol = do