rspec/rules/S1927/html/rule.adoc

40 lines
719 B
Plaintext
Raw Normal View History

== Why is this an issue?
2021-04-28 16:49:39 +02:00
This rule checks that the specified attributes are present in HTML tags.
=== Noncompliant code example
2021-04-28 16:49:39 +02:00
Given a required attribute list of: ``++img.alt,img.height,img.width++``:
2022-02-04 17:28:24 +01:00
[source,html]
2021-04-28 16:49:39 +02:00
----
<img src="/images/queen.png"> <!-- Noncompliant; missing all required attributes -->
----
=== Compliant solution
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,html]
2021-04-28 16:49:39 +02:00
----
<img src="/images/queen.png" width="60" height="85" alt="Elizabeth II">
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
include::parameters.adoc[]
'''
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]