mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-08 16:05:05 -04:00
quick and dirty title support implementation
This commit is contained in:
parent
1d8dd16a21
commit
9a5ae726bc
3 changed files with 79 additions and 25 deletions
|
@ -104,16 +104,26 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument)
|
|||
start = start?'start="'+Security.escapeHTMLAttribute(start[1])+'"':'';
|
||||
if (listType)
|
||||
{
|
||||
if(listType.indexOf("number") < 0)
|
||||
{
|
||||
preHtml = '<ul class="list-' + Security.escapeHTMLAttribute(listType) + '"><li>';
|
||||
postHtml = '</li></ul>';
|
||||
}
|
||||
else
|
||||
var details = /([a-z]+)([12345678])/.exec(listType);
|
||||
//handle numbered lists
|
||||
if(details[1] == "number")
|
||||
{
|
||||
preHtml = '<ol '+start+' class="list-' + Security.escapeHTMLAttribute(listType) + '"><li>';
|
||||
postHtml = '</li></ol>';
|
||||
}
|
||||
//handle titles
|
||||
else if(details[1] == "title")
|
||||
{
|
||||
markup = 'h'+Number(details[2]);
|
||||
preHtml = '<'+markup+'>';
|
||||
postHtml = '</'+markup+'>';
|
||||
}
|
||||
//handle bullet lists and indentations
|
||||
else
|
||||
{
|
||||
preHtml = '<ul class="list-' + Security.escapeHTMLAttribute(listType) + '"><li>';
|
||||
postHtml = '</li></ul>';
|
||||
}
|
||||
}
|
||||
result.lineMarker += txt.length;
|
||||
return; // don't append any text
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue