Maintainer | hapytexeu+gh@gmail.com |
---|---|
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe |
Language | Haskell2010 |
A module to encode and decode css selector strings. These are used in the parser and renderer to parse and render css selector strings.
Synopsis
- readIdentifier :: String -> String
- encodeIdentifier :: Text -> Text
- isValidIdentifier :: String -> Bool
- toIdentifier :: (Text -> a) -> String -> a
- readCssString :: String -> String
- encodeString :: Char -> String -> String
- encodeText :: Char -> Text -> Text
Identifiers
:: String | The given css identifier to parse. |
-> String | The result of the parsing: the content of the identifier. |
Parse a given css identifier to the content of the identifier.
Encode a given identifier to its css selector equivalent by escaping certain characters.
Check if the given identifier is a valid css selector identifier.
:: (Text -> a) | The given function to wrap the |
-> String | The string to validate, and wrap into the given function. |
-> a | The identifier object to return if the identifier is valid. |
Convert the given string to a given object by first checking if it is a valid identifier, and if not raising an error. If it is a valid identifier, the string is packed, and wrapped in the given function.
Css strings
:: String | The string that contains the string literal in the css selector. |
-> String | A string that contains the content of the string literal. |
Parses a css string literal to a string that ontains the content of that string literal.
:: Char | The type of quotes that should be put around the content (should be |
-> String | The string that should be converted to a css selector string literal. |
-> String | The corresponding css selector string literal. |
Convert a string to a css selector string literal. This is done by putting quotes around the content, and escaping certain characters.
:: Char | The type of quotes that should be put around the content (should be |
-> Text | The string that should be converted to a css selector string literal. |
-> Text | The corresponding css selector string literal. |
Convert a string to a css selector string literal. This is done by putting quotes around the content, and escaping certain characters.