git.iko.soy/typeable/pandoc
on master help sign in
Textile reader: Correctly handle entities.
commit50ba5a801a2593598f1484c7ce4aa941f00ed0b0 authorJohn MacFarlane <jgm@berkeley.edu> dateTue 11 Jun 2013, 10:16 (13 years ago) parent96f25f9
3 files changed+9−1
src/Text/Pandoc/Readers/Textile.hs+2−1 tests/textile-reader.native+2 tests/textile-reader.textile+5
src/Text/Pandoc/Readers/Textile.hs+2−1
@@ -374,6 +374,7 @@ inlineParsers = [ str
374374 , link
375375 , image
376376 , mark
377+ , (Str . (:[])) <$> characterReference
377378 , smartPunctuation inline
378379 , symbol
379380 ]
@@ -424,7 +425,7 @@ note = try $ do
424425
425426-- | Special chars
426427markupChars :: [Char]
427−markupChars = "\\*#_@~-+^|%=[]"
428+markupChars = "\\*#_@~-+^|%=[]&"
428429
429430-- | Break strings on following chars. Space tab and newline break for
430431-- inlines breaking. Open paren breaks for mark. Quote, dash and dot
tests/textile-reader.native+2
@@ -134,6 +134,8 @@ Pandoc (Meta {docTitle = [], docAuthors = [], docDate = []})
134134 ,[[Plain [Str "joan"]]
135135 ,[Plain [Str "24"]]
136136 ,[Plain [Str "f"]]]]
137+,Header 1 ("",[],[]) [Str "Entities"]
138+,Para [Str "*",LineBreak,Str "&"]
137139,Header 1 ("",[],[]) [Str "Raw",Space,Str "HTML"]
138140,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 ":"]
139141,RawBlock "html" "<div class=\"foobar\">"
tests/textile-reader.textile+5
@@ -203,6 +203,11 @@ table{foo:bar}.
203203| name | age | sex |
204204| joan | 24 | f |
205205
206+h1. Entities
207+
208+&#42;
209+&amp;
210+
206211h1. Raw HTML
207212
208213However, <strong> raw HTML inlines </strong> are accepted, as well as :