keep integrity on paste and better styling but new lists dont reset counter

This commit is contained in:
John McLear 2013-04-09 14:29:55 +01:00
parent 2e76bd4e50
commit 90c5b26e89
2 changed files with 16 additions and 12 deletions

View file

@ -114,11 +114,13 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument)
else
{
if(start){ // is it a start of a list with more than one item in?
if(start[1] == 1){ // if its the first one
preHtml = '<ol class="list-start-' + listType + ' list-' + Security.escapeHTMLAttribute(listType) + '"><li>';
}else{ // its the second+ item in this list level
preHtml = '<ol class="list-' + Security.escapeHTMLAttribute(listType) + '"><li>';
if(start[1] == 1){ // if its the first one at this level?
preHtml = '<ol start=1 class="list-start-' + listType + ' list-' + Security.escapeHTMLAttribute(listType) + '"><li>';
}else{ // its not the first item in this list level
preHtml = '<ol start='+start[1]+' class="list-' + Security.escapeHTMLAttribute(listType) + '"><li>';
}
}else{
preHtml = '<ol class="list-' + Security.escapeHTMLAttribute(listType) + '"><li>'; // Handles pasted contents into existing lists
}
postHtml = '</li></ol>';
}