.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / stylelint / lib / rules / string-no-newline / README.md
1 # string-no-newline
2
3 Disallow (unescaped) newlines in strings.
4
5 ```css
6 a {
7   content: "first
8     second";     ↑
9 }                ↑
10 /**              ↑
11  * The newline here */
12 ```
13
14 [The spec](https://www.w3.org/TR/CSS2/syndata.html#strings) says this: "A string cannot directly contain a newline. To include a newline in a string, use an escape representing the line feed character in ISO-10646 (U+000A), such as \"\A\" or \"\00000a\"." And also: "It is possible to break strings over several lines, for aesthetic or other reasons, but in such a case the newline itself has to be escaped with a backslash (\)."
15
16 ## Options
17
18 ### `true`
19
20 The following patterns are considered violations:
21
22 ```css
23 a {
24   content: "first
25     second";     
26 }  
27 ```
28
29 ```css
30 [title="something
31 is probably wrong"] {}  
32 ```
33
34 ```css
35 a {
36   font-family: "Times
37     New
38     Roman";
39 }  
40 ```
41
42 The following patterns are *not* considered violations:
43
44 ```css
45 a {
46   content: "first\Asecond";     
47 }  
48 ```
49
50 ```css
51 a {
52   content: "first\\nsecond";     
53 }  
54 ```
55
56 ```css
57 [title="nothing\
58   is wrong"] {}  
59 ```
60
61 ```css
62 a {
63   font-family: "Times New Roman";
64 }  
65 ```