From e190cadcca2a6a2795bcfb09f953eb9fa712a406 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Thu, 5 Jan 2012 21:31:47 +0000 Subject: [PATCH] Minor tweaks to link class handling --- js/WikiStore.js | 8 +++++--- js/WikiTextParseTree.js | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/js/WikiStore.js b/js/WikiStore.js index 94cffb498..7c5be1269 100755 --- a/js/WikiStore.js +++ b/js/WikiStore.js @@ -81,7 +81,9 @@ WikiStore.prototype.forEachTiddler = function(/* [sortField,[excludeTag,]]callba sortField = arguments.length > 1 ? arguments[a++] : null, excludeTag = arguments.length > 2 ? arguments[a++] : null, callback = arguments[a++], - t,tiddlers = [],tiddler; + t, + tiddlers = [], + tiddler; if(sortField) { for(t in this.tiddlers) { tiddlers.push(this.tiddlers[t]); @@ -170,7 +172,7 @@ WikiStore.prototype.getFormattedTiddlerField = function(title,field,format,templ return utils.htmlEncode(tiddler.fields[field]); case "link": // xxx: Attribute encoding is wrong - return "" + utils.htmlEncode(tiddler.fields[field]) + ""; + return "" + utils.htmlEncode(tiddler.fields[field]) + ""; case "wikified": return this.renderTiddler("text/html",tiddler.fields.title); case "date": @@ -191,7 +193,7 @@ WikiStore.prototype.classesForLink = function(target) { } else { className = "linkInternalMissing"; } - return className !== "" ? "class=\"" + className + "\"" : ""; + return className !== "" ? " class=\"" + className + "\"" : ""; }; WikiStore.prototype.listTiddlers = function(type,template,emptyMessage) { diff --git a/js/WikiTextParseTree.js b/js/WikiTextParseTree.js index d795f7a52..2320ae425 100644 --- a/js/WikiTextParseTree.js +++ b/js/WikiTextParseTree.js @@ -156,7 +156,6 @@ WikiTextParseTree.prototype.compileElementHtml = function(element, options) { } this.pushString("<" + tagBits.join(" ") + (options.selfClosing ? " /" : "")); if(options.insertAfterAttributes) { - this.pushString(" "); this.output.push(options.insertAfterAttributes); } this.pushString(">");