mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 07:56:16 -04:00
Merge pull request #1709 from ether/keep-list-order-on-paste
When you paste into a numbered list, keep some integrity
This commit is contained in:
commit
f9d23767f8
2 changed files with 79 additions and 21 deletions
|
@ -104,7 +104,6 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument)
|
|||
if (listType)
|
||||
{
|
||||
listType = listType[1];
|
||||
start = start?'start="'+Security.escapeHTMLAttribute(start[1])+'"':'';
|
||||
if (listType)
|
||||
{
|
||||
if(listType.indexOf("number") < 0)
|
||||
|
@ -114,7 +113,14 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument)
|
|||
}
|
||||
else
|
||||
{
|
||||
preHtml = '<ol '+start+' class="list-' + Security.escapeHTMLAttribute(listType) + '"><li>';
|
||||
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?
|
||||
lineClass = lineClass + " " + "list-start-" + listType; // Add start class to DIV node
|
||||
}
|
||||
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>';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue