Ordered list support

This commit is contained in:
John McLear 2012-01-15 17:20:20 +00:00
parent c45932c6b8
commit f4dca37a93
14 changed files with 316 additions and 31 deletions

View file

@ -95,13 +95,23 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument)
if (cls.indexOf('list') >= 0)
{
var listType = /(?:^| )list:(\S+)/.exec(cls);
var start = /(?:^| )start:(\S+)/.exec(cls);
if (listType)
{
listType = listType[1];
start = start?'start="'+start[1]+'"':'';
if (listType)
{
preHtml = '<ul class="list-' + listType + '"><li>';
postHtml = '</li></ul>';
if(listType.indexOf("number") < 0)
{
preHtml = '<ul class="list-' + listType + '"><li>';
postHtml = '</li></ul>';
}
else
{
preHtml = '<ol '+start+' class="list-' + listType + '"><li>';
postHtml = '</li></ol>';
}
}
result.lineMarker += txt.length;
return; // don't append any text