freebsd-ports/textproc/hs-HaXml/files/patch-1.13-percent
Maxime Henrion 5979290699 Add a patch from the upstream author to fix a well-known bug when parsing
XML files with attributes containing the ' %' character.
2006-06-01 19:26:51 +00:00

21 lines
1.2 KiB
Text

--- src/Text/XML/HaXml/Lex.hs.orig 2005-04-19 13:22:15.000000000 +0100
+++ src/Text/XML/HaXml/Lex.hs 2006-02-21 15:46:57.000000000 +0000
@@ -194,12 +194,12 @@
| close `prefixes` (s:ss) = emit (TokFreeText (reverse acc)) pos:
emit tok p:
skip (length close-1) (addcol 1 p) ss k
- | s=='&'||s=='%' = (if not (null acc)
- then (emit (TokFreeText (reverse acc)) pos:)
- else id)
- (emit (if s=='&' then TokAmp else TokPercent) p:
- textUntil ";" TokSemi "" p (addcol 1 p) ss
- (\p' i-> textOrRefUntil close tok "" p p' i k))
+ | s=='&' = (if not (null acc)
+ then (emit (TokFreeText (reverse acc)) pos:)
+ else id)
+ (emit TokAmp p:
+ textUntil ";" TokSemi "" p (addcol 1 p) ss
+ (\p' i-> textOrRefUntil close tok "" p p' i k))
| isSpace s = textOrRefUntil close tok (s:acc) pos (white s p) ss k
| otherwise = textOrRefUntil close tok (s:acc) pos (addcol 1 p) ss k