aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2013-06-11 10:16:54 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2013-06-11 10:16:54 -0700
commit50ba5a801a2593598f1484c7ce4aa941f00ed0b0 (patch)
tree1d9505a088c0c47eb53304206c27935266aebafa
parent96f25f924a6de58bc313d78697f0f0f65307d891 (diff)
downloadpandoc-50ba5a801a2593598f1484c7ce4aa941f00ed0b0.tar.gz
Textile reader: Correctly handle entities.
-rw-r--r--src/Text/Pandoc/Readers/Textile.hs3
-rw-r--r--tests/textile-reader.native2
-rw-r--r--tests/textile-reader.textile5
3 files changed, 9 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Textile.hs b/src/Text/Pandoc/Readers/Textile.hs
index 8d259482d..22ec52362 100644
--- a/src/Text/Pandoc/Readers/Textile.hs
+++ b/src/Text/Pandoc/Readers/Textile.hs
@@ -374,6 +374,7 @@ inlineParsers = [ str
, link
, image
, mark
+ , (Str . (:[])) <$> characterReference
, smartPunctuation inline
, symbol
]
@@ -424,7 +425,7 @@ note = try $ do
-- | Special chars
markupChars :: [Char]
-markupChars = "\\*#_@~-+^|%=[]"
+markupChars = "\\*#_@~-+^|%=[]&"
-- | Break strings on following chars. Space tab and newline break for
-- inlines breaking. Open paren breaks for mark. Quote, dash and dot
diff --git a/tests/textile-reader.native b/tests/textile-reader.native
index 71d9774b3..adb9c01f3 100644
--- a/tests/textile-reader.native
+++ b/tests/textile-reader.native
@@ -134,6 +134,8 @@ Pandoc (Meta {docTitle = [], docAuthors = [], docDate = []})
,[[Plain [Str "joan"]]
,[Plain [Str "24"]]
,[Plain [Str "f"]]]]
+,Header 1 ("",[],[]) [Str "Entities"]
+,Para [Str "*",LineBreak,Str "&"]
,Header 1 ("",[],[]) [Str "Raw",Space,Str "HTML"]
,Para [Str "However",Str ",",Space,RawInline "html" "<strong>",Space,Str "raw",Space,Str "HTML",Space,Str "inlines",Space,RawInline "html" "</strong>",Space,Str "are",Space,Str "accepted",Str ",",Space,Str "as",Space,Str "well",Space,Str "as",Space,Str ":"]
,RawBlock "html" "<div class=\"foobar\">"
diff --git a/tests/textile-reader.textile b/tests/textile-reader.textile
index 5d5a6c593..e31052b6a 100644
--- a/tests/textile-reader.textile
+++ b/tests/textile-reader.textile
@@ -203,6 +203,11 @@ table{foo:bar}.
| name | age | sex |
| joan | 24 | f |
+h1. Entities
+
+&#42;
+&amp;
+
h1. Raw HTML
However, <strong> raw HTML inlines </strong> are accepted, as well as :