1 | .Dd August 9, 2013
|
---|
2 | .Dt cssesc 1
|
---|
3 | .Sh NAME
|
---|
4 | .Nm cssesc
|
---|
5 | .Nd escape text for use in CSS string literals or identifiers
|
---|
6 | .Sh SYNOPSIS
|
---|
7 | .Nm
|
---|
8 | .Op Fl i | -identifier Ar string
|
---|
9 | .br
|
---|
10 | .Op Fl s | -single-quotes Ar string
|
---|
11 | .br
|
---|
12 | .Op Fl d | -double-quotes Ar string
|
---|
13 | .br
|
---|
14 | .Op Fl w | -wrap Ar string
|
---|
15 | .br
|
---|
16 | .Op Fl e | -escape-everything Ar string
|
---|
17 | .br
|
---|
18 | .Op Fl v | -version
|
---|
19 | .br
|
---|
20 | .Op Fl h | -help
|
---|
21 | .Sh DESCRIPTION
|
---|
22 | .Nm
|
---|
23 | escapes strings for use in CSS string literals or identifiers while generating the shortest possible valid ASCII-only output.
|
---|
24 | .Sh OPTIONS
|
---|
25 | .Bl -ohang -offset
|
---|
26 | .It Sy "-s, --single-quotes"
|
---|
27 | Escape any occurences of ' in the input string as \\', so that the output can be used in a CSS string literal wrapped in single quotes.
|
---|
28 | .It Sy "-d, --double-quotes"
|
---|
29 | Escape any occurences of " in the input string as \\", so that the output can be used in a CSS string literal wrapped in double quotes.
|
---|
30 | .It Sy "-w, --wrap"
|
---|
31 | Make sure the output is a valid CSS string literal wrapped in quotes. The type of quotes can be specified using the
|
---|
32 | .Ar -s | --single-quotes
|
---|
33 | or
|
---|
34 | .Ar -d | --double-quotes
|
---|
35 | settings.
|
---|
36 | .It Sy "-e, --escape-everything"
|
---|
37 | Escape all the symbols in the output, even printable ASCII symbols.
|
---|
38 | .It Sy "-v, --version"
|
---|
39 | Print cssesc's version.
|
---|
40 | .It Sy "-h, --help"
|
---|
41 | Show the help screen.
|
---|
42 | .El
|
---|
43 | .Sh EXIT STATUS
|
---|
44 | The
|
---|
45 | .Nm cssesc
|
---|
46 | utility exits with one of the following values:
|
---|
47 | .Pp
|
---|
48 | .Bl -tag -width flag -compact
|
---|
49 | .It Li 0
|
---|
50 | .Nm
|
---|
51 | successfully escaped the given text and printed the result.
|
---|
52 | .It Li 1
|
---|
53 | .Nm
|
---|
54 | wasn't instructed to escape anything (for example, the
|
---|
55 | .Ar --help
|
---|
56 | flag was set); or, an error occurred.
|
---|
57 | .El
|
---|
58 | .Sh EXAMPLES
|
---|
59 | .Bl -ohang -offset
|
---|
60 | .It Sy "cssesc 'foo bar baz'"
|
---|
61 | Print an escaped version of the given text.
|
---|
62 | .It Sy echo\ 'foo bar baz'\ |\ cssesc
|
---|
63 | Print an escaped version of the text that gets piped in.
|
---|
64 | .El
|
---|
65 | .Sh BUGS
|
---|
66 | cssesc's bug tracker is located at <https://github.com/mathiasbynens/cssesc/issues>.
|
---|
67 | .Sh AUTHOR
|
---|
68 | Mathias Bynens <https://mathiasbynens.be/>
|
---|
69 | .Sh WWW
|
---|
70 | <https://mths.be/cssesc>
|
---|