aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--guidelines/wikipedia/spaceBetweenListItems.js18
1 files changed, 8 insertions, 10 deletions
diff --git a/guidelines/wikipedia/spaceBetweenListItems.js b/guidelines/wikipedia/spaceBetweenListItems.js
index 9802606..890b31c 100644
--- a/guidelines/wikipedia/spaceBetweenListItems.js
+++ b/guidelines/wikipedia/spaceBetweenListItems.js
@@ -2,16 +2,14 @@ exports.name = "Do not separate list items with blank lines";
exports.description = "Leaving blank lines between list items causes mediawiki to end one list and to start a new one.";
exports.rule = function(report) {
- $5('li:only-of-type').each(reportWarning);
- $5('dl:has(dt):has(dd)').each(function(i, dl) {
- var $dd = $(dl).find('dd');
- if ($dd.length === 1) {
- reportWarning(i, dl);
- }
- });
+ $5('ol:has(> li:only-of-type) + ol:has(> li:only-of-type)').each(reportWarning);
+ $5('ul:has(> li:only-of-type) + ul:has(> li:only-of-type)').each(reportWarning);
- function reportWarning(i, li) {
- var text = $.trim($(li).text());
- report.warning('List with a single item: '+ text, li);
+ $5('dl:has(> dt:only-of-type):has(> dd:only-of-type) + '+
+ 'dl:has(> dt:only-of-type):has(> dd:only-of-type)').each(reportWarning);
+
+ function reportWarning(i, list) {
+ var text = $.trim($(list).text());
+ report.warning('List with a single item: '+ text, list);
}
};