Commit 77c63c4e authored by Steffen Michels's avatar Steffen Michels

fixed parsing of named entity references with spaces in between

parent c63ccb61
......@@ -257,7 +257,7 @@ where
case lexCharData` offset [] of
Error e = Just $ Fail e
Ok ([], _) = Nothing
Ok (dataStrings, end) = Just $ Token end (TokenCharData $ concat dataStrings)
Ok (dataStrings, end) = Just $ Token end (TokenCharData $ trim $ concat dataStrings)
where
lexCharData` :: !Int ![String] -> MaybeErrorString (![String], !Int)
lexCharData` offset accum
......@@ -269,12 +269,10 @@ where
(Error $ concat ["Unknown named character entity reference '", name, "'"])
(\charString -> lexCharData` (end + 1) [charString: accum])
(entityCharacter name)
| isTextChar input.[offset]
| input.[offset] <> '<'
# end = findEnd isTextChar input (offset + 1)
# data = trim (input % (offset, end - 1))
| data <> "" = lexCharData` end [data: accum]
| otherwise = Ok (accum, offset)
| otherwise = Ok (reverse accum, offset)
= lexCharData` end [input % (offset, end - 1): accum]
| otherwise = Ok (reverse accum, offset)
where
isTextChar c = c <> '<' && c <> '&'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment