module Codec.Epub.Util
where
import Text.Regex
removeIllegalStartChars :: String -> String
removeIllegalStartChars :: String -> String
removeIllegalStartChars = forall a. (a -> Bool) -> [a] -> [a]
dropWhile (forall a. Eq a => a -> a -> Bool
/= Char
'<')
removeEncoding :: String -> String
removeEncoding :: String -> String
removeEncoding = forall a b c. (a -> b -> c) -> b -> a -> c
flip (Regex -> String -> String -> String
subRegex
(String -> Bool -> Bool -> Regex
mkRegexWithOpts String
" +encoding=\"UTF-8\"" Bool
False Bool
False)) String
""
removeDoctype :: String -> String
removeDoctype :: String -> String
removeDoctype = forall a b c. (a -> b -> c) -> b -> a -> c
flip (Regex -> String -> String -> String
subRegex
(String -> Bool -> Bool -> Regex
mkRegexWithOpts String
"<!DOCTYPE [^>]*>" Bool
False Bool
True)) String
""