aboutsummaryrefslogtreecommitdiff
path: root/guidelines/wikipedia/src/strikeout.js
blob: e1e38563ef1489cd7300180780bac0152dc198da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
exports.name = "Don't use strikeout.";
exports.description = "By default, most screen readers do not indicate presentational text attributes (bold, italic, underline) or even semantic text attributes (emphasis, importance, text deletion), so struck-out text is read normally along with any other text.";

exports.rule = function (report) {
  var err = function(idx, elt) {
    report.error("Strikeout tags should not be used.", elt);
  };

  $5('#mw-content-text del').each(err);
  $5('#mw-content-text strike').each(err);
  $5('#mw-content-text span').filter(function(i, s) {
    return (/line-through/).test($(s).css('text-decoration'));
  }).each(err);
};