Skip to content

Files

Latest commit

 

History

History
62 lines (47 loc) · 1.06 KB

string-no-newline.md

File metadata and controls

62 lines (47 loc) · 1.06 KB

Pattern: Unexpected newline in string

Issue: -

Description

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. 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.

Examples

The following patterns are considered violations:

a {
  content: "first
    second";     ↑
}                ↑
/**              ↑
 * The newline here */
[title="something
is probably wrong"] {}  
a {
  font-family: "Times
    New
    Roman";
}  

The following patterns are not considered violations:

a {
  content: "first\Asecond";     
}  
a {
  content: "first\\nsecond";     
}  
[title="nothing\
  is wrong"] {}  
a {
  font-family: "Times New Roman";
}  

Further Reading