cleaner logic

pull/2101/head
John McLear 2014-03-05 21:44:32 +00:00
parent df205a4ef4
commit f5716a3b26
1 changed files with 5 additions and 22 deletions

View File

@ -119,37 +119,20 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument)
{ {
if(listType.indexOf("number") < 0) if(listType.indexOf("number") < 0)
{ {
if(!preHtml){
preHtml = '<ul class="list-' + Security.escapeHTMLAttribute(listType) + '"><li>';
postHtml = '</li></ul>';
}else{
preHtml += '<ul class="list-' + Security.escapeHTMLAttribute(listType) + '"><li>'; preHtml += '<ul class="list-' + Security.escapeHTMLAttribute(listType) + '"><li>';
postHtml = '</li></ul>' + postHtml; postHtml = '</li></ul>' + postHtml;
} }
}
else else
{ {
if(start){ // is it a start of a list with more than one item in? if(start){ // is it a start of a list with more than one item in?
if(start[1] == 1){ // if its the first one at this level? if(start[1] == 1){ // if its the first one at this level?
lineClass = lineClass + " " + "list-start-" + listType; // Add start class to DIV node lineClass = lineClass + " " + "list-start-" + listType; // Add start class to DIV node
} }
if(!preHtml){
preHtml = '<ol start='+start[1]+' class="list-' + Security.escapeHTMLAttribute(listType) + '"><li>';
}else{
preHtml += '<ol start='+start[1]+' class="list-' + Security.escapeHTMLAttribute(listType) + '"><li>'; preHtml += '<ol start='+start[1]+' class="list-' + Security.escapeHTMLAttribute(listType) + '"><li>';
}
}else{
if(!preHtml){
preHtml = '<ol class="list-' + Security.escapeHTMLAttribute(listType) + '"><li>'; // Handles pasted contents into existing lists
}else{ }else{
preHtml += '<ol class="list-' + Security.escapeHTMLAttribute(listType) + '"><li>'; // Handles pasted contents into existing lists preHtml += '<ol class="list-' + Security.escapeHTMLAttribute(listType) + '"><li>'; // Handles pasted contents into existing lists
} }
} postHtml += '</li></ol>';
if(!postHtml){
postHtml = '</li></ol>';
}else{
postHtml = '</li></ol>';
}
} }
} }
processedMarker = true; processedMarker = true;