From 318381a21b186329fa3107447e9d7cbc279a1736 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Fri, 9 Dec 2011 12:26:36 +0000 Subject: [PATCH] Fixed problem with tiddler context within macros --- js/Recipe.js | 8 ++++---- js/WikiTextMacros.js | 43 +++++++++++++++++++++++-------------------- js/WikiTextParser.js | 4 ++-- js/WikiTextRules.js | 2 +- 4 files changed, 30 insertions(+), 27 deletions(-) diff --git a/js/Recipe.js b/js/Recipe.js index ca2bf8174..5e325692e 100755 --- a/js/Recipe.js +++ b/js/Recipe.js @@ -282,13 +282,13 @@ Recipe.prototype.cookRss = function() numRssItems = 20, s = [], d = new Date(), - u = this.store.getTiddler("SiteUrl").getParseTree().render("text/plain"), + u = this.store.getTiddler("SiteUrl").getParseTree().render("text/plain",me.store,"SiteUrl"), encodeTiddlyLink = function(title) { return title.indexOf(" ") == -1 ? title : "[[" + title + "]]"; }, tiddlerToRssItem = function(tiddler,uri) { var s = "" + utils.htmlEncode(tiddler.fields.title) + "\n"; - s += "" + utils.htmlEncode(tiddler.getParseTree().render("text/html")) + "\n"; + s += "" + utils.htmlEncode(tiddler.getParseTree().render("text/html",me.store,tiddler.fields.title)) + "\n"; var i; if(tiddler.fields.tags) { for(i=0; i"); s.push(""); s.push(""); - s.push("" + utils.htmlEncode(this.store.getTiddler("SiteTitle").getParseTree().render("text/plain")) + ""); + s.push("" + utils.htmlEncode(this.store.getTiddler("SiteTitle").getParseTree().render("text/plain",me.store,"SiteTitle")) + ""); if(u) s.push("" + utils.htmlEncode(u) + ""); - s.push("" + utils.htmlEncode(this.store.getTiddler("SiteSubtitle").getParseTree().render("text/plain")) + ""); + s.push("" + utils.htmlEncode(this.store.getTiddler("SiteSubtitle").getParseTree().render("text/plain",me.store,"SiteSubtitle")) + ""); //s.push("" + config.locale + ""); s.push("" + d.toUTCString() + ""); s.push("" + d.toUTCString() + ""); diff --git a/js/WikiTextMacros.js b/js/WikiTextMacros.js index fe47cc7ed..b5efc0d9b 100644 --- a/js/WikiTextMacros.js +++ b/js/WikiTextMacros.js @@ -13,22 +13,25 @@ var ArgParser = require("./ArgParser.js").ArgParser, var wikiTextMacros = exports; -wikiTextMacros.executeMacros = function(tree,store,tiddler) { +wikiTextMacros.versionTiddlyWiki = "2.6.5"; + +wikiTextMacros.executeMacros = function(tree,store,title) { for(var t=0; t