kopia lustrzana https://github.com/miklobit/TiddlyWiki5
Minor tweaks to link class handling
rodzic
f155c150e2
commit
e190cadcca
|
@ -81,7 +81,9 @@ WikiStore.prototype.forEachTiddler = function(/* [sortField,[excludeTag,]]callba
|
||||||
sortField = arguments.length > 1 ? arguments[a++] : null,
|
sortField = arguments.length > 1 ? arguments[a++] : null,
|
||||||
excludeTag = arguments.length > 2 ? arguments[a++] : null,
|
excludeTag = arguments.length > 2 ? arguments[a++] : null,
|
||||||
callback = arguments[a++],
|
callback = arguments[a++],
|
||||||
t,tiddlers = [],tiddler;
|
t,
|
||||||
|
tiddlers = [],
|
||||||
|
tiddler;
|
||||||
if(sortField) {
|
if(sortField) {
|
||||||
for(t in this.tiddlers) {
|
for(t in this.tiddlers) {
|
||||||
tiddlers.push(this.tiddlers[t]);
|
tiddlers.push(this.tiddlers[t]);
|
||||||
|
@ -170,7 +172,7 @@ WikiStore.prototype.getFormattedTiddlerField = function(title,field,format,templ
|
||||||
return utils.htmlEncode(tiddler.fields[field]);
|
return utils.htmlEncode(tiddler.fields[field]);
|
||||||
case "link":
|
case "link":
|
||||||
// xxx: Attribute encoding is wrong
|
// xxx: Attribute encoding is wrong
|
||||||
return "<a href='" + utils.htmlEncode(tiddler.fields[field]) + "' " + this.classesForLink(tiddler.fields[field]) + ">" + utils.htmlEncode(tiddler.fields[field]) + "</a>";
|
return "<a href='" + utils.htmlEncode(tiddler.fields[field]) + "'" + this.classesForLink(tiddler.fields[field]) + ">" + utils.htmlEncode(tiddler.fields[field]) + "</a>";
|
||||||
case "wikified":
|
case "wikified":
|
||||||
return this.renderTiddler("text/html",tiddler.fields.title);
|
return this.renderTiddler("text/html",tiddler.fields.title);
|
||||||
case "date":
|
case "date":
|
||||||
|
@ -191,7 +193,7 @@ WikiStore.prototype.classesForLink = function(target) {
|
||||||
} else {
|
} else {
|
||||||
className = "linkInternalMissing";
|
className = "linkInternalMissing";
|
||||||
}
|
}
|
||||||
return className !== "" ? "class=\"" + className + "\"" : "";
|
return className !== "" ? " class=\"" + className + "\"" : "";
|
||||||
};
|
};
|
||||||
|
|
||||||
WikiStore.prototype.listTiddlers = function(type,template,emptyMessage) {
|
WikiStore.prototype.listTiddlers = function(type,template,emptyMessage) {
|
||||||
|
|
|
@ -156,7 +156,6 @@ WikiTextParseTree.prototype.compileElementHtml = function(element, options) {
|
||||||
}
|
}
|
||||||
this.pushString("<" + tagBits.join(" ") + (options.selfClosing ? " /" : ""));
|
this.pushString("<" + tagBits.join(" ") + (options.selfClosing ? " /" : ""));
|
||||||
if(options.insertAfterAttributes) {
|
if(options.insertAfterAttributes) {
|
||||||
this.pushString(" ");
|
|
||||||
this.output.push(options.insertAfterAttributes);
|
this.output.push(options.insertAfterAttributes);
|
||||||
}
|
}
|
||||||
this.pushString(">");
|
this.pushString(">");
|
||||||
|
|
Ładowanie…
Reference in New Issue