EPUB: Don't use any decimal entities.

kindlegen doesn't like them - even '.
It should be safe to use the unescaped ' character, since
we know that all attributes are double quoted in the relevant
files.
This commit is contained in:
John MacFarlane 2011-12-13 08:13:27 -08:00
parent d8d68c5110
commit 412580c223

View file

@ -284,8 +284,8 @@ ppTopElement = ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" ++) . unEntity .
let (ds,ys) = break (==';') xs
rest = drop 1 ys
in case reads ('\'':'\\':ds ++ "'") of
((x,_):_) | x > '\127' -> x : unEntity rest
_ -> ('&':'#':ds) ++ ";" ++ unEntity rest
((x,_):_) -> x : unEntity rest
_ -> '&':'#':unEntity xs
unEntity (x:xs) = x : unEntity xs
imageTypeOf :: FilePath -> Maybe String