github-actions[bot] 289d34d78c
Create rule S6821: Implement rule in html (#3855)
* Add html to rule S6821

* Update with html rspec

* Share rationale

* Address comments

* Comments

---------

Co-authored-by: zglicz <zglicz@users.noreply.github.com>
Co-authored-by: Michal Zgliczynski <michal.zgliczynski@sonarsource.com>
Co-authored-by: Victor <victor.diez@sonarsource.com>
2024-04-11 09:27:08 +02:00

24 lines
559 B
Plaintext

include::../rationale.adoc[]
This rule does not cover non-DOM elements, such as custom components.
include::../fix.adoc[]
[source,javascript,diff-id=1,diff-type=noncompliant]
----
<div role="meth" aria-label="a^{2} + b^{2} = c^{2}">
a<sup>2</sup> + b<sup>2</sup> = c<sup>2</sup>
</div>
----
To fix the code use a valid value for the ARIA role attribute.
[source,javascript,diff-id=1,diff-type=compliant]
----
<div role="math" aria-label="a^{2} + b^{2} = c^{2}">
a<sup>2</sup> + b<sup>2</sup> = c<sup>2</sup>
</div>
----
include::../resources.adoc[]