diff --git a/core/modules/macros/list/list.js b/core/modules/macros/list/list.js index 70ed219f3..e78bd383f 100644 --- a/core/modules/macros/list/list.js +++ b/core/modules/macros/list/list.js @@ -26,7 +26,7 @@ exports.info = { listview: {byName: true, type: "text"}, itemClass: {byName: true, type: "text"}, map: {byName: true, type: "tiddler"}, - forceBlock: {ByName: true, type: "text"} // HACK: To be removed... + block: {ByName: true, type: "text"} // HACK: To be removed... } }; @@ -43,8 +43,8 @@ var typeMappings = { exports.executeMacro = function() { this.useBlock = this.isBlock; - if(this.hasParameter("forceBlock")) { - this.useBlock = true; + if(this.hasParameter("block")) { + this.useBlock = this.params.block === "yes"; } // Get the list of tiddlers object this.getTiddlerList(); @@ -154,7 +154,10 @@ exports.createListElementMacro = function(title) { if(!template) { if(this.content.length > 0) { // Use our content as the template - templateTree = this.content; + templateTree = []; + for(var t=0; t>) -(((My filter expression))) -(((My filter expression))(MyTemplate)) -(((My filter expression))Template <>) +{{MyTiddler}} +{{MyTiddler}{MyTemplate}} +{{MyTiddler}Template <>} }}} \*/ @@ -26,31 +23,25 @@ exports.name = "transclude"; exports.runParser = true; exports.blockParser = true; -exports.regExpString = "\\(\\((?:(?:[^\\(\\)]+)|(?:\\([^\\(\\)]+\\)))\\)(?:\\([^\\)]+\\)|(?:[^\\)]+))?\\)"; +exports.regExpString = "\\{\\{(?:(?:[^\\{\\}]+)|(?:\\{[^\\{\\}]+\\}))\\}(?:\\{[^\\}]+\\}|(?:[^\\}]+))?\\}"; exports.parse = function(match,isBlock) { - var regExp = /\(\((?:([^\(\)]+)|(?:\(([^\(\)]+)\)))\)(?:\(([^\)]+)\)|([^\)]+))?\)((?:\r?\n)?)/mg; + var regExp = /\{\{([^\{\}]+)\}(?:\{([^\}]+)\}|([^\}]+))?\}((?:\r?\n)?)/mg; regExp.lastIndex = this.pos; match = regExp.exec(this.source); if(match && match.index === this.pos) { this.pos = match.index + match[0].length; var macro, params = {}, parseTree; - // Check if it is a single tiddler if(match[1]) { - macro = "tiddler"; params.target = match[1]; - } else { - // Else it is a filter - macro = "list"; - params.filter = match[2]; + } + if(match[2]) { + params.template = match[2]; } if(match[3]) { - params.template = match[3]; + parseTree = this.wiki.parseText("text/vnd.tiddlywiki",match[3]).tree; } - if(match[4]) { - parseTree = this.wiki.parseText("text/vnd.tiddlywiki",match[4]).tree; - } - return [$tw.Tree.Macro(macro,{ + return [$tw.Tree.Macro("tiddler",{ srcParams: params, wiki: this.wiki, content: parseTree diff --git a/core/templates/StaticContent.tid b/core/templates/StaticContent.tid index 1c89eab32..eebc6d0ed 100644 --- a/core/templates/StaticContent.tid +++ b/core/templates/StaticContent.tid @@ -2,4 +2,8 @@ title: $:/templates/StaticContent type: text/vnd.tiddlywiki <> -((( [!is[shadow]sort[title]] ))
<>
) +<< + +
<>
+ +>> diff --git a/core/templates/TagTemplate.tid b/core/templates/TagTemplate.tid index 7067fda24..874da32ef 100644 --- a/core/templates/TagTemplate.tid +++ b/core/templates/TagTemplate.tid @@ -1,6 +1,6 @@ title: $:/templates/TagTemplate -{{btn-invisible{ +{{btn-invisible tw-tag-button{ <