diff options
author | Jesse Hallett <jesse@galois.com> | 2014-01-06 14:21:47 -0800 |
---|---|---|
committer | Jesse Hallett <jesse@galois.com> | 2014-01-06 14:44:54 -0800 |
commit | 800b351ff47165b041d8be5b2a4d9944579ab337 (patch) | |
tree | 13b457fe292a400c1b1b9e826982fca209ad4b21 | |
parent | dbcf8d56fb0b20d5abb58e20944ee3a79c052f14 (diff) |
Changes pseudo-heading rule to permit paragraphs with bold and non-bold text
-rw-r--r-- | guidelines/wikipedia/src/pseudoHeadings.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/guidelines/wikipedia/src/pseudoHeadings.js b/guidelines/wikipedia/src/pseudoHeadings.js index bbf7d8d..1776b6e 100644 --- a/guidelines/wikipedia/src/pseudoHeadings.js +++ b/guidelines/wikipedia/src/pseudoHeadings.js @@ -3,8 +3,11 @@ exports.description = "Do not make pseudo-headings using bold or semicolon marku exports.rule = function(report) { $5('#mw-content-text p > b:only-child').each(function(i, b) { - var text = $.trim($(b).text()); - report.error('Bold text used as pseudo-heading: '+ text, b); + var boldText = $.trim($(b).text()); + var paraText = $.trim($(b).closest('p').text()); + if (boldText && boldText === paraText) { + report.error('Bold text used as pseudo-heading: '+ boldText, b); + } }); $5('#mw-content-text dl:not(:has(dd)) dt').each(function(i, dt) { |