summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Readers/Textile.hs4
-rw-r--r--tests/textile-reader.native2
-rw-r--r--tests/textile-reader.textile6
3 files changed, 10 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Textile.hs b/src/Text/Pandoc/Readers/Textile.hs
index 6f64540f8..17c6583ff 100644
--- a/src/Text/Pandoc/Readers/Textile.hs
+++ b/src/Text/Pandoc/Readers/Textile.hs
@@ -594,10 +594,12 @@ specialAttribute = do
("justify" <$ try (string "<>")) <|>
("right" <$ char '>') <|>
("left" <$ char '<')
+ notFollowedBy spaceChar
return $ addStyle ("text-align:" ++ alignStr)
attribute :: Parser [Char] ParserState (Attr -> Attr)
-attribute = classIdAttr <|> styleAttr <|> langAttr
+attribute = try $
+ (classIdAttr <|> styleAttr <|> langAttr) <* notFollowedBy spaceChar
classIdAttr :: Parser [Char] ParserState (Attr -> Attr)
classIdAttr = try $ do -- (class class #id)
diff --git a/tests/textile-reader.native b/tests/textile-reader.native
index 79a5f52da..2e8a6d01c 100644
--- a/tests/textile-reader.native
+++ b/tests/textile-reader.native
@@ -146,6 +146,8 @@ Pandoc (Meta {unMeta = fromList []})
,[[Plain [Str "joan"]]
,[Plain [Str "24"]]
,[Plain [Str "f"]]]]
+,Para [Emph [Str "(class#id)",Space,Str "emph"]]
+,Para [Emph [Str "(no",Space,Str "class#id)",Space,Str "emph"]]
,Header 1 ("entities",[],[]) [Str "Entities"]
,Para [Str "*",LineBreak,Str "&"]
,Header 1 ("raw-html",[],[]) [Str "Raw",Space,Str "HTML"]
diff --git a/tests/textile-reader.textile b/tests/textile-reader.textile
index a9c80ccbd..6c6754997 100644
--- a/tests/textile-reader.textile
+++ b/tests/textile-reader.textile
@@ -213,7 +213,7 @@ h2>. Right
h2<>{color:blue}[en]. Justified
-as well as *(foo)inline attributes* of %{color:red} all kind%
+as well as *(foo)inline attributes* of %{color:red}all kind%
p{color:green}. and paragraph attributes, and table attributes.
@@ -221,6 +221,10 @@ table{foo:bar}.
| name | age | sex |
| joan | 24 | f |
+_(class#id) emph_
+
+_(no class#id) emph_
+
h1. Entities
&#42;