string-no-newline
Disallow invalid newlines within strings.
a { content: "foo bar"; }/* ↑ * ↑ * The newline here */Use this rule to avoid declarations that browsers ignore. An unescaped newline in a string invalidates the whole declaration.
The spec 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 (\).”
This rule doesn’t have any message arguments.
Options
Section titled “Options”{ "string-no-newline": true}The following patterns are considered problems:
a { content: "foo bar";}[title="somethingis probably wrong"] {}a { font-family: "Times New Roman";}The following patterns are not considered problems:
a { content: "foo\Abar";}a { content: "foo\\nbar";}[title="nothing\ is wrong"] {}a { font-family: "Times New Roman";}Optional secondary options
Section titled “Optional secondary options”ignore
Section titled “ignore”{ "ignore": ["array", "of", "options"] }"at-rule-preludes"
Section titled “"at-rule-preludes"”Ignore strings in at-rule preludes.
{ "string-no-newline": [true, { "ignore": ["at-rule-preludes"] }]}The following patterns are not considered problems:
@import url('foo.css');"declaration-values"
Section titled “"declaration-values"”Ignore strings in declaration values.
The following patterns are not considered problems:
a { content: "foo bar";}