equalizedigital / accessibility-checker

GNU General Public License v2.0
15 stars 8 forks source link

Unexpected empty paragraph tag #666

Closed amberhinds closed 2 weeks ago

amberhinds commented 3 weeks ago

@pattonwebz can you investigate why this is flagging an empty paragraph tag warning?

<p class="lockup"> <img src="https://2024.wpaccessibility.day/wp-content/themes/wp-a11y-day/assets/lockup.png" alt="WpA11yDay" width="250"> </p>// {{ .lockup }}

Screenshot 2024-06-11 at 10 32 46 PM
pattonwebz commented 3 weeks ago

@amberhinds This is happening because the first node inside the paragraph is whitespace. I had the check set up with the assumption that if the paragraph was not empty, then its first node would be another HTML tag.

I opened a PR that tweaks the check so that it does not matter if the paragraph content starts with whitespace or in what order the first text or HTML tag appears.