mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 08:10:35 +00:00
Renamed items to itemCount for better code readability.
Change-Id: I53851c07a4746928fddec4b3737136f081d49178
This commit is contained in:
parent
58da03bc85
commit
ae4810b201
|
@ -30,11 +30,11 @@ WSP._listHandler = function( bullet, state, token ) {
|
|||
} else {
|
||||
var curList = stack[stack.length - 1];
|
||||
bullets = curList.bullets + bullet;
|
||||
curList.items++;
|
||||
curList.itemCount++;
|
||||
if ( // deeply nested list
|
||||
curList.items > 2 ||
|
||||
curList.itemCount > 2 ||
|
||||
// A nested list, not directly after the li
|
||||
( curList.items > 1 &&
|
||||
( curList.itemCount > 1 &&
|
||||
! ( state.lastToken.constructor === TagTk &&
|
||||
state.lastToken.name === 'li') )) {
|
||||
res = bullets;
|
||||
|
@ -42,7 +42,7 @@ WSP._listHandler = function( bullet, state, token ) {
|
|||
res = bullet;
|
||||
}
|
||||
}
|
||||
stack.push({ items: 0, bullets: bullets});
|
||||
stack.push({ itemCount: 0, bullets: bullets});
|
||||
return res;
|
||||
};
|
||||
|
||||
|
@ -61,9 +61,9 @@ WSP._listItemHandler = function ( state, token ) {
|
|||
return '';
|
||||
} else {
|
||||
var curList = stack[stack.length - 1];
|
||||
curList.items++;
|
||||
curList.itemCount++;
|
||||
// > 1 ==> consecutive list items
|
||||
return ( curList.items > 1 ) ? curList.bullets : '';
|
||||
return ( curList.itemCount > 1 ) ? curList.bullets : '';
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue