Skip to content

Commit

Permalink
fix(a11y): do not warn if href value is dynamic (#6110)
Browse files Browse the repository at this point in the history
  • Loading branch information
thollander authored Apr 30, 2021
1 parent 20cb783 commit 842b841
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/compiler/compile/nodes/Attribute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default class Attribute extends Node {
}

get_static_value() {
if (this.is_spread || this.dependencies.size > 0) return null;
if (!this.is_static) return null;

return this.is_true
? true
Expand Down
3 changes: 2 additions & 1 deletion test/validator/samples/a11y-anchor-has-content/input.svelte
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<a href='/foo'></a>
<a href='/foo'></a>
<a href="#{'foo'}">bar</a>

0 comments on commit 842b841

Please sign in to comment.