From 15a644f91a8b6e80bbd24a824b91c24547b80035 Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Wed, 18 Dec 2013 17:09:13 -0800 Subject: Wikipedia guideline: checks for pseudo-headings --- guidelines/wikipedia/pseudoHeadings.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 guidelines/wikipedia/pseudoHeadings.js (limited to 'guidelines/wikipedia/pseudoHeadings.js') 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); + }); +}; -- cgit v1.2.3