From ae4810b2012b469ef69b5d05da24f45e59e15f4c Mon Sep 17 00:00:00 2001 From: Subramanya Sastry Date: Thu, 17 May 2012 12:32:46 -0500 Subject: [PATCH] Renamed items to itemCount for better code readability. Change-Id: I53851c07a4746928fddec4b3737136f081d49178 --- modules/parser/mediawiki.WikitextSerializer.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/parser/mediawiki.WikitextSerializer.js b/modules/parser/mediawiki.WikitextSerializer.js index f81ea0f311..f3ce260234 100644 --- a/modules/parser/mediawiki.WikitextSerializer.js +++ b/modules/parser/mediawiki.WikitextSerializer.js @@ -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 : ''; } };