rspec/rules/S4652/css/rule.adoc

53 lines
940 B
Plaintext
Raw Normal View History

== Why is this an issue?
2021-04-28 16:49:39 +02:00
According to the W3C specifications:
____
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".
{empty}[...]
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 (\).
____
=== Noncompliant code example
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,css]
2021-04-28 16:49:39 +02:00
----
a {
content: "first
second";
}
----
=== Compliant solution
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,css]
2021-04-28 16:49:39 +02:00
----
a {
content: "first\Asecond";
}
----
== Resources
2021-04-28 16:49:39 +02:00
* https://www.w3.org/TR/CSS2/syndata.html#strings[CSS Specification] - Strings
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Replace this new line with a line feed character in ISO-10646 encoding.
endif::env-github,rspecator-view[]