1CSS::DOM::Util(3) User Contributed Perl Documentation CSS::DOM::Util(3)
2
3
4
6 CSS::DOM::Util - Utility functions for dealing with CSS tokens
7
9 Version 0.17
10
12 use CSS::DOM::Util ':all';
13 # or:
14 use CSS::DOM::Util qw[
15 escape unescape
16 escape_ident unescape_url
17 escape_str unescape_str
18 ];
19
21 This module provides utility functions for dealing with CSS tokens.
22
24 All functions below that take one argument have a "($)" prototype, so
25 they have the same precedence as "closedir" and "delete".
26
27 escape $string, $chars_to_escape
28 This escapes any characters in $string that occur in
29 $chars_to_escape, which is interpreted as a regular expression. The
30 regexp must consume just one character; otherwise you'll find chars
31 missing from the output. ASCII vertical whitespace (except the
32 vertical tab) is always escaped.
33
34 Printable non-alphanumeric ASCII characters and the space character
35 are escaped with a single backslash. Other characters are encoded
36 in hexadecimal.
37
38 "escape" also considers that you might want to include the escaped
39 string in a larger string, so it appends a space if the escaped
40 string ends with a hexadecimal escape with fewer than six digits.
41
42 unescape $string
43 This turns something like \"H\65llo\" into "Hello" (including
44 quotes).
45
46 escape_ident $string
47 escape_ident $string, $more_chars_to_escape
48 This escapes $string as a CSS identifier, escaping also any
49 characters matched by $more_chars_to_escape.
50
51 unescape_url $url_token
52 Returns the URL that the token represents.
53
54 escape_str $string
55 Returns a CSS string token containing $string (within quotes;
56 characters possibly escaped).
57
58 unescape_str $string_token
59 Returns the value that a CSS string token represents.
60
62 CSS::DOM
63
64
65
66perl v5.36.0 2023-01-20 CSS::DOM::Util(3)