Skip to content
21 changes: 11 additions & 10 deletions packages/yew-macro/src/html_tree/lint/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,26 +70,27 @@ impl Lint for AHrefLint {
if let syn::Lit::Str(href) = &lit.lit {
let href_value = href.value();
match href_value.as_ref() {
"#" | "javascript:void(0)" => emit_warning!(
lit.span(),
format!("'{href_value}' is not a suitable value for the `href` attribute. \
"#" | "javascript:void(0)" => emit_warning!(
lit.span(),
format!(
"'{href_value}' is not a suitable value for the `href` attribute. \
Without a meaningful attribute assistive technologies \
will struggle to understand your webpage. \
https://developer.mozilla.org/en-US/docs/Learn/Accessibility/HTML#onclick_events"
)),
_ => {}

}
)
),
_ => {}
}
}
};
}
_ => {
emit_warning!(
quote::quote! {#tag_name}.span(),
"All `<a>` elements should have a `href` attribute. This makes it possible \
quote::quote! {#tag_name}.span(),
"All `<a>` elements should have a `href` attribute. This makes it possible \
for assistive technologies to correctly interpret what your links point to. \
https://developer.mozilla.org/en-US/docs/Learn/Accessibility/HTML#more_on_links"
)
)
}
}
}
Expand Down
Loading
Loading