diff --git a/js/Formatter.js b/js/Formatter.js index b95a85988..e15beee0a 100755 --- a/js/Formatter.js +++ b/js/Formatter.js @@ -56,6 +56,13 @@ Formatter.createElementAndWikify = function(w) { w.subWikifyTerm(e.children,this.termRegExp); }; +Formatter.setAttr = function(e,attr,value) { + if(!"attributes" in e) { + e.attributes = {}; + } + e.attributes[attr] = value; +} + Formatter.inlineCssHelper = function(w) { var styles = []; textPrimitives.cssLookaheadRegExp.lastIndex = w.nextMatch; @@ -254,7 +261,7 @@ Formatter.formatters = [ termRegExp: /(\n)/mg, handler: function(w) { - var e = {type: "h" + w.matchLength, attributes: {}, children: []}; + var e = {type: "h" + w.matchLength, children: []}; w.output.push(e); w.subWikifyTerm(e.children,this.termRegExp); } @@ -295,7 +302,7 @@ Formatter.formatters = [ if(listLevel > currLevel) { for(t=currLevel; t