File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
lib/erblint-github/linters/github/accessibility
test/linters/accessibility Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -10,11 +10,11 @@ class NoTitleAttribute < Linter
1010 include ERBLint ::Linters ::CustomHelpers
1111 include LinterRegistry
1212
13- MESSAGE = "The title attribute should never be used unless for an `<iframe>` as it is inaccessible for several groups of users."
13+ MESSAGE = "The title attribute should never be used as it is inaccessible for several groups of users. Exceptions are <iframe> and <link> ."
1414
1515 def run ( processed_source )
1616 tags ( processed_source ) . each do |tag |
17- next if tag . name == "iframe"
17+ next if tag . name == "iframe" || tag . name == "link"
1818 next if tag . closing?
1919
2020 title = possible_attribute_values ( tag , "title" )
Original file line number Diff line number Diff line change @@ -22,4 +22,11 @@ def test_does_not_warn_if_iframe_sets_title
2222
2323 assert_empty @linter . offenses
2424 end
25+
26+ def test_does_not_warn_if_link_sets_title
27+ @file = "<link rel='unapi-server' type='application/xml' title='unAPI' href='/unapi'/></link>"
28+ @linter . run ( processed_source )
29+
30+ assert_empty @linter . offenses
31+ end
2532end
You can’t perform that action at this time.
0 commit comments