From 666bdcaaf829ffad9e5adcaa87bfd5f0c69cf532 Mon Sep 17 00:00:00 2001 From: Jean-Tiare Le Bigot Date: Fri, 2 Mar 2012 19:41:55 +0100 Subject: [PATCH] fixed style disapearing when adding a char + added a comment to describe the trick in contentcollector --- static/js/ace2_inner.js | 1 - static/js/contentcollector.js | 4 ++++ static/js/domline.js | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/static/js/ace2_inner.js b/static/js/ace2_inner.js index 581a9222e..a90b2bd46 100644 --- a/static/js/ace2_inner.js +++ b/static/js/ace2_inner.js @@ -5267,7 +5267,6 @@ function Ace2Inner(){ } setLineListTypes(mods); } - function doInsertUnorderedList(){ doInsertList('bullet'); } diff --git a/static/js/contentcollector.js b/static/js/contentcollector.js index 2e7edd097..0b730976c 100644 --- a/static/js/contentcollector.js +++ b/static/js/contentcollector.js @@ -457,6 +457,10 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class } else if (!isEmpty) { + //It is interesting to notice that the rendering code of this part relies + //on the attributes stored in the "class" attribute of the DOM element. + //It means that whenever one wants to create a new attribute, he will + //need to put it as a class ! var styl = dom.nodeAttr(node, "style"); var cls = dom.nodeProp(node, "className"); diff --git a/static/js/domline.js b/static/js/domline.js index 8c1489512..88d430cfc 100644 --- a/static/js/domline.js +++ b/static/js/domline.js @@ -115,7 +115,7 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument) else if(details[1] == "title") { markup = 'h'+Number(details[2]); - preHtml = '<'+markup+'>'; + preHtml = '<'+markup+' class="list-' + Security.escapeHTMLAttribute(listType) +' >'; postHtml = ''; } //handle bullet lists and indentations