Skip to content

Commit

Permalink
Resolve SONARHTML-234
Browse files Browse the repository at this point in the history
Note that this rule is not include in the Sonar way profile so there was no need to demote it.
  • Loading branch information
ericmorand-sonarsource committed Apr 16, 2024
1 parent 9212890 commit 5ef17bb
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<p>This rule is deprecated, and will eventually be removed.</p>
<h2>Why is this an issue?</h2>
<p>Heading tags are used by search engines and screen reader softwares to construct an outline of the page.</p>
<p>Starting at <code>&lt;h1&gt;</code> and not skipping any level eases this automatic construction.</p>
<h3>Noncompliant code example</h3>
<pre>
&lt;h2&gt;My Title&lt;/h2&gt; &lt;!-- Non-Compliant - h1 is not being used --&gt;

&lt;h3&gt;My Sub Title&lt;/h3&gt; &lt;!-- Compliant --&gt;
</pre>
<h3>Compliant solution</h3>
<pre>
&lt;h1&gt;My Title&lt;/h1&gt; &lt;!-- Compliant --&gt;

&lt;h2&gt;My Sub Title&lt;/h2&gt; &lt;!-- Compliant --&gt;
</pre>

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"title": "Heading tags should be used consecutively from \"H1\" to \"H6\"",
"type": "CODE_SMELL",
"status": "deprecated",
"remediation": {
"func": "Constant\/Issue",
"constantCost": "5min"
},
"tags": [
"accessibility"
],
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-1086",
"sqKey": "NonConsecutiveHeadingCheck",
"scope": "Main",
"quickfix": "unknown"
}

0 comments on commit 5ef17bb

Please sign in to comment.