Utility functions for dealing with css tokens
Version 0.15
use CSS::DOM::Util ':all'; # or: use CSS::DOM::Util qw[ escape unescape escape_ident unescape_url escape_str unescape_str ];
This module provides utility functions for dealing with \s-1CSS\s0 tokens.
All functions below that take one argument have a \*(C`($)\*(C' prototype, so they have the same precedence as \*(C`closedir\*(C' and \*(C`delete\*(C'. This escapes any characters in $string that occur in $chars_to_escape, which is interpreted as a regular expression. The regexp must consume just one character; otherwise you'll find chars missing from the output. \s-1ASCII\s0 vertical whitespace (except the vertical tab) is always escaped. Printable non-alphanumeric \s-1ASCII\s0 characters and the space character are escaped with a single backslash. Other characters are encoded in hexadecimal. \*(C`escape\*(C' also considers that you might want to include the escaped string in a larger string, so it appends a space if the escaped string ends with a hexadecimal escape with fewer than six digits. This turns something like \\*(L"H\65llo\\*(R" into \*(L"Hello\*(R" (including quotes). This escapes $string as a \s-1CSS\s0 identifier, escaping also any characters matched by $more_chars_to_escape. Returns the \s-1URL\s0 that the token represents. Returns a \s-1CSS\s0 string token containing $string (within quotes; characters possibly escaped). Returns the value that a \s-1CSS\s0 string token represents.
\s-1CSS::DOM\s0