quick and dirty title support implementation

This commit is contained in:
Jean-Tiare Le Bigot 2012-03-02 14:40:46 +01:00
parent 1d8dd16a21
commit 9a5ae726bc
3 changed files with 79 additions and 25 deletions

View file

@ -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