mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-02-02 12:19:11 +00:00
Fixed the view macro to reuse the link macro
This commit is contained in:
parent
1e05d673b1
commit
4681d14f39
@ -357,6 +357,18 @@ WikiStore.prototype.renderTiddler = function(targetType,title,asTitle) {
|
||||
return null;
|
||||
};
|
||||
|
||||
/*
|
||||
Executes a macro and returns the result
|
||||
*/
|
||||
WikiStore.prototype.renderMacro = function(macroName,targetType,tiddler,params) {
|
||||
var macro = this.macros[macroName];
|
||||
if(macro) {
|
||||
return macro.handler(targetType,tiddler,this,params);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Refresh a DOM node so that it reflects the current state of the store
|
||||
|
||||
|
@ -23,12 +23,7 @@ exports.macro = {
|
||||
if(v) {
|
||||
switch(params.format) {
|
||||
case "link":
|
||||
if(type === "text/html") {
|
||||
return "<a href='" + encoder(v) + "'" + store.classesForLink(v) + ">" + encoder(v) + "</a>";
|
||||
} else {
|
||||
return v;
|
||||
}
|
||||
break; // JSHint wants this even though it's not really necessary
|
||||
return store.renderMacro("link",type,tiddler,{target: v});
|
||||
case "wikified":
|
||||
return store.renderTiddler(type,tiddler.fields.title);
|
||||
case "date":
|
||||
|
Loading…
Reference in New Issue
Block a user