The rule Web:BoldAndItalicTagsCheck is inherently false

The description of this rule claims that

<strong> and <em> have a semantic meaning whereas <b> and <i> only convey styling information like CSS

This is factually incorrect since HTML5. Both <b> and <i> do have semantic meaning and those semantics are different to the suggested alternatives of <strong> and <em>, respectively. There is no way of knowing whether the author is (incorrectly) using these elements for styling only, or whether they are correctly using them for their semantics.

By advising authors to switch from <b> and <i> to <strong> and <em> this rule is effectively advising to change the semantics of the document in a way which could be incorrect.

Moreover, by claiming in the description that the former elements have no semantic meaning and are for styling only, the rule is perpetuating a falsehood and miseducating readers.

Hey @daiscog,

Welcome to the community!

I agree. The rule seems to be outdated for HTML5. It should be deprecated+removed or removed from the standard profile and the description rewritten.

I did create [SONARHTML-157] Web:BoldAndItalicTagsCheck is outdated for HTML5 - SonarSource to track this. Until the ticket is handled (not planned yet), I can only advise you to remove the rule from the profile used for scanning.

Thank you for reporting this!


1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.