diff options
author | Jesse Hallett <jesse@galois.com> | 2013-12-18 17:09:13 -0800 |
---|---|---|
committer | Jesse Hallett <jesse@galois.com> | 2013-12-18 17:09:13 -0800 |
commit | 15a644f91a8b6e80bbd24a824b91c24547b80035 (patch) | |
tree | 388f1194faa23c189aaee8798fa6f96ea8c868da | |
parent | 7844e7c226712e2d5c27d7eca1e68b01fed1de43 (diff) |
Wikipedia guideline: checks for pseudo-headings
-rw-r--r-- | guidelines/wikipedia/pseudoHeadings.js | 14 | ||||
-rw-r--r-- | guidelines/wikipedia/wikipedia.json | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/guidelines/wikipedia/pseudoHeadings.js b/guidelines/wikipedia/pseudoHeadings.js new file mode 100644 index 0000000..bbf7d8d --- /dev/null +++ b/guidelines/wikipedia/pseudoHeadings.js @@ -0,0 +1,14 @@ +exports.name = "Do not make pseudo-headings"; +exports.description = "Do not make pseudo-headings using bold or semicolon markup."; + +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); + }); + + $5('#mw-content-text dl:not(:has(dd)) dt').each(function(i, dt) { + var text = $.trim($(dt).text()); + report.error('Semicolon markup used to create pseudo-heading: '+ text, dt); + }); +}; diff --git a/guidelines/wikipedia/wikipedia.json b/guidelines/wikipedia/wikipedia.json index 216c2e6..67adf30 100644 --- a/guidelines/wikipedia/wikipedia.json +++ b/guidelines/wikipedia/wikipedia.json @@ -10,5 +10,6 @@ , "paragraphLength.js" , "imageSize.js" , "horizontalRule.js" + , "pseudoHeadings.js" ] } |