@@ -7,6 +7,7 @@ use syn::spanned::Spanned;
77use super :: html_element:: { HtmlElement , TagName } ;
88use super :: HtmlTree ;
99use crate :: props:: { ElementProps , Prop } ;
10+ use crate :: DisplayExt ;
1011
1112/// Lints HTML elements to check if they are well formed. If the element is not well-formed, then
1213/// use `proc-macro-error` (and the `emit_warning!` macro) to produce a warning. At present, these
@@ -50,7 +51,7 @@ fn get_attribute<'a>(props: &'a ElementProps, name: &str) -> Option<&'a Prop> {
5051 props
5152 . attributes
5253 . iter ( )
53- . find ( |item| item. label . eq_ignore_ascii_case ( name) )
54+ . find ( |item| item. label . eq_str_ignore_ascii_case ( name) )
5455}
5556
5657/// Lints to check if anchor (`<a>`) tags have valid `href` attributes defined.
@@ -59,7 +60,7 @@ pub struct AHrefLint;
5960impl Lint for AHrefLint {
6061 fn lint ( element : & HtmlElement ) {
6162 if let TagName :: Lit ( ref tag_name) = element. name {
62- if !tag_name. eq_ignore_ascii_case ( "a" ) {
63+ if !tag_name. eq_str_ignore_ascii_case ( "a" ) {
6364 return ;
6465 } ;
6566 if let Some ( prop) = get_attribute ( & element. props , "href" ) {
@@ -81,7 +82,7 @@ impl Lint for AHrefLint {
8182 } ;
8283 } else {
8384 emit_warning ! (
84- quote :: quote! { # tag_name} . span( ) ,
85+ tag_name. span( ) ,
8586 "All `<a>` elements should have a `href` attribute. This makes it possible \
8687 for assistive technologies to correctly interpret what your links point to. \
8788 https://developer.mozilla.org/en-US/docs/Learn/Accessibility/HTML#more_on_links"
@@ -97,7 +98,7 @@ pub struct ImgAltLint;
9798impl Lint for ImgAltLint {
9899 fn lint ( element : & HtmlElement ) {
99100 if let super :: html_element:: TagName :: Lit ( ref tag_name) = element. name {
100- if !tag_name. eq_ignore_ascii_case ( "img" ) {
101+ if !tag_name. eq_str_ignore_ascii_case ( "img" ) {
101102 return ;
102103 } ;
103104 if get_attribute ( & element. props , "alt" ) . is_none ( ) {
0 commit comments