summaryrefslogtreecommitdiff
path: root/src/static
diff options
context:
space:
mode:
Diffstat (limited to 'src/static')
-rw-r--r--src/static/js/domline.js26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/static/js/domline.js b/src/static/js/domline.js
index 82dafb42..b1927b16 100644
--- a/src/static/js/domline.js
+++ b/src/static/js/domline.js
@@ -101,6 +101,17 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument)
{
var listType = /(?:^| )list:(\S+)/.exec(cls);
var start = /(?:^| )start:(\S+)/.exec(cls);
+
+ _.map(hooks.callAll("aceDomLinePreProcessLineAttributes", {
+ domline: domline,
+ cls: cls
+ }), function(modifier)
+ {
+ preHtml += modifier.preHtml;
+ postHtml += modifier.postHtml;
+ processedMarker |= modifier.processedMarker;
+ });
+
if (listType)
{
listType = listType[1];
@@ -108,8 +119,8 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument)
{
if(listType.indexOf("number") < 0)
{
- preHtml = '<ul class="list-' + Security.escapeHTMLAttribute(listType) + '"><li>';
- postHtml = '</li></ul>';
+ preHtml += '<ul class="list-' + Security.escapeHTMLAttribute(listType) + '"><li>';
+ postHtml = '</li></ul>' + postHtml;
}
else
{
@@ -117,16 +128,15 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument)
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>';
+ 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
+ preHtml += '<ol class="list-' + Security.escapeHTMLAttribute(listType) + '"><li>'; // Handles pasted contents into existing lists
}
- postHtml = '</li></ol>';
+ postHtml += '</li></ol>';
}
}
processedMarker = true;
}
-
_.map(hooks.callAll("aceDomLineProcessLineAttributes", {
domline: domline,
cls: cls
@@ -136,13 +146,10 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument)
postHtml += modifier.postHtml;
processedMarker |= modifier.processedMarker;
});
-
if( processedMarker ){
result.lineMarker += txt.length;
return; // don't append any text
}
-
-
}
var href = null;
var simpleTags = null;
@@ -245,7 +252,6 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument)
{
return curHTML || '';
};
-
return result;
};