From 5884ff6994e739bd46be4914adcb7fc9cc093056 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 8 Jan 2016 17:32:50 -0800 Subject: Work around tagsoup bug - not allowing uppercase x in hex entities. Issue submitted at tagsoup. --- src/Text/Pandoc/Parsing.hs | 1 + src/Text/Pandoc/XML.hs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Text/Pandoc/Parsing.hs b/src/Text/Pandoc/Parsing.hs index db891d5d4..16fe75ed5 100644 --- a/src/Text/Pandoc/Parsing.hs +++ b/src/Text/Pandoc/Parsing.hs @@ -574,6 +574,7 @@ characterReference = try $ do char '&' ent <- many1Till nonspaceChar (char ';') let ent' = case ent of + '#':'X':xs -> '#':'x':xs -- workaround tagsoup bug '#':_ -> ent _ -> ent ++ ";" case lookupEntity ent' of diff --git a/src/Text/Pandoc/XML.hs b/src/Text/Pandoc/XML.hs index 1e01b62f2..82ceff126 100644 --- a/src/Text/Pandoc/XML.hs +++ b/src/Text/Pandoc/XML.hs @@ -107,6 +107,7 @@ fromEntities ('&':xs) = (zs,';':ys) -> (zs,ys) (zs, ys) -> (zs,ys) ent' = case ent of + '#':'X':xs -> '#':'x':xs -- workaround tagsoup bug '#':_ -> ent _ -> ent ++ ";" -- cgit v1.2.3