diff options
author | Jesse Hallett <jesse@galois.com> | 2013-12-23 14:59:23 -0800 |
---|---|---|
committer | Jesse Hallett <jesse@galois.com> | 2013-12-23 14:59:23 -0800 |
commit | 3ce47cad3750be90fc57110bb0a80456bf58dbba (patch) | |
tree | b6261bb43402a9eecfe835df1d2dcc06a4eaea30 | |
parent | 3de8afaa1a204aac019bc4404c9deecb64621b00 (diff) |
Looks for adjacent singleton lists instead of just for singleton lists
-rw-r--r-- | guidelines/wikipedia/spaceBetweenListItems.js | 18 |
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); } }; |