- | Parse a unicode character.
--
-- > \\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?
--
-- A unicode character starts with a backslash and then contains up to
-- six hex digits. If a character in the range [0-9a-fA-F] follows the
-- hexadecimal number, the end of the number needs to be made
-- clear. This is done by providing exactly 6 digits or by adding a
-- single white space character at the end.
--
-- This parser will grab any valid hexadecimal number. The following
-- restriction is not implemented in this parser.
--
-- If the number is outside the range allowed by Unicode (e.g.,
-- "\110000" is above the maximum 10FFFF allowed in current Unicode),
-- the UA may replace the escape with the "replacement character"
-- (U+FFFD). 
--
-- This should implemented at a level above the parser.
-- 
-- See
-- <http://www.w3.org/International/questions/qa-escapes#cssescapes>
-- for another example of how these are used.
unicode :: Parser String
unicode = (do a <- string "\\"
              b <- try (count 6 hexDigit) 
                 <|> (do c <- many1 hexDigit
                         unicodeEnd
                         return c) <?> "unicode digits"
              return $ a ++ b) <?> "unicode"

unicode :: Parser String
unicode = (do a <- string "\\"
              b <- try (count 6 hexDigit) 
                 <|> (do c <- many1 hexDigit
                         unicodeEnd
                         return c) <?> "unicode digits"
              return $ a ++ b) <?> "unicode"
unicode = (do a <- string "\\"
              b <- try (count 6 hexDigit) 
                 <|> (do c <- many1 hexDigit
                         unicodeEnd
                         return c) <?> "unicode digits"
              return $ a ++ b) <?> "unicode"