From 06d5e345c0a11cc722d737b2fe33d79fbfa90ece Mon Sep 17 00:00:00 2001 From: Jean-Tiare Le Bigot Date: Thu, 8 Dec 2011 17:48:49 +0100 Subject: [PATCH] fix renumbering when indented text is mixed with regular lists --- static/js/ace2_inner.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/static/js/ace2_inner.js b/static/js/ace2_inner.js index 282c42fdc..3fa494f31 100644 --- a/static/js/ace2_inner.js +++ b/static/js/ace2_inner.js @@ -5178,8 +5178,11 @@ function OUTER(gscope) } //2-find the first line of the list - while(lineNum-1 >= 0 && getLineListType(lineNum-1)) + while(lineNum-1 >= 0 && (type=getLineListType(lineNum-1))) { + type = /([a-z]+)[12345678]/.exec(type); + if(type[1] == "indent") + break; lineNum--; } @@ -5197,9 +5200,9 @@ function OUTER(gscope) while(listType = getLineListType(line)) { //apply new num - curLevel = /[a-z]+([12345678])/.exec(listType); - curLevel = Number(curLevel[1]); - if(isNaN(curLevel)) + listType = /([a-z]+)([12345678])/.exec(listType); + curLevel = Number(listType[2]); + if(isNaN(curLevel) || listType[0] == "indent") { return line; }