-
-
Notifications
You must be signed in to change notification settings - Fork 30
[Bug] anchor-has-content fires when an anchor contains a child div using v-html #191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I experienced the same |
Can one of you attach the source file that's not working? This test line: https://github.com/vue-a11y/eslint-plugin-vuejs-accessibility/blob/main/src/rules/__tests__/anchor-has-content.test.ts#L9 I believe covers what you're talking about, so I need a snippet that violates to reproduce. |
The problem arises when the v-html is part of a child node rather than the anchor itself. Here's a minimal test case: <a href="http://google.com">
<span v-html="googleLabel" />
</a> For my real-world use case, my anchor tag has both an icon and a label, the label div has the |
Ahh!! I see. I will get this fixed, thanks for the repro! |
We're using the
v-html
attribute to give an anchor its readable contents, but the plugin is only looking for anchors to contain a child element that has inner text.When an anchor uses
v-html
or any of its child elements do, that should count as readable content. (Sure, thev-html
might return a blank value, but so can a template{{ variable }}
).The text was updated successfully, but these errors were encountered: