.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "CSS::DOM::Util 3pm" .TH CSS::DOM::Util 3pm "2018-02-12" "perl v5.26.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" CSS::DOM::Util \- Utility functions for dealing with CSS tokens .SH "VERSION" .IX Header "VERSION" Version 0.17 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 7 \& use CSS::DOM::Util \*(Aq:all\*(Aq; \& # or: \& use CSS::DOM::Util qw[ \& escape unescape \& escape_ident unescape_url \& escape_str unescape_str \& ]; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module provides utility functions for dealing with \s-1CSS\s0 tokens. .SH "FUNCTIONS" .IX Header "FUNCTIONS" All functions below that take one argument have a \f(CW\*(C`($)\*(C'\fR prototype, so they have the same precedence as \f(CW\*(C`closedir\*(C'\fR and \f(CW\*(C`delete\*(C'\fR. .ie n .IP "escape $string, $chars_to_escape" 4 .el .IP "escape \f(CW$string\fR, \f(CW$chars_to_escape\fR" 4 .IX Item "escape $string, $chars_to_escape" This escapes any characters in \f(CW$string\fR that occur in \&\f(CW$chars_to_escape\fR, 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. .Sp Printable non-alphanumeric \s-1ASCII\s0 characters and the space character are escaped with a single backslash. Other characters are encoded in hexadecimal. .Sp \&\f(CW\*(C`escape\*(C'\fR 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. .ie n .IP "unescape $string" 4 .el .IP "unescape \f(CW$string\fR" 4 .IX Item "unescape $string" This turns something like \e\*(L"H\e65llo\e\*(R" into \*(L"Hello\*(R" (including quotes). .ie n .IP "escape_ident $string" 4 .el .IP "escape_ident \f(CW$string\fR" 4 .IX Item "escape_ident $string" .PD 0 .ie n .IP "escape_ident $string, $more_chars_to_escape" 4 .el .IP "escape_ident \f(CW$string\fR, \f(CW$more_chars_to_escape\fR" 4 .IX Item "escape_ident $string, $more_chars_to_escape" .PD This escapes \f(CW$string\fR as a \s-1CSS\s0 identifier, escaping also any characters matched by \f(CW$more_chars_to_escape\fR. .ie n .IP "unescape_url $url_token" 4 .el .IP "unescape_url \f(CW$url_token\fR" 4 .IX Item "unescape_url $url_token" Returns the \s-1URL\s0 that the token represents. .ie n .IP "escape_str $string" 4 .el .IP "escape_str \f(CW$string\fR" 4 .IX Item "escape_str $string" Returns a \s-1CSS\s0 string token containing \f(CW$string\fR (within quotes; characters possibly escaped). .ie n .IP "unescape_str $string_token" 4 .el .IP "unescape_str \f(CW$string_token\fR" 4 .IX Item "unescape_str $string_token" Returns the value that a \s-1CSS\s0 string token represents. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\s-1CSS::DOM\s0