From 9482717c947e2a9c187462e01bcffcf94549b391 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Tue, 29 May 2012 22:16:02 +0100 Subject: [PATCH] Add block mode macros to tiddlytextparser Which improves the whitespace handling for building TW2.6.x --- core/modules/parsers/tiddlytextparser.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/modules/parsers/tiddlytextparser.js b/core/modules/parsers/tiddlytextparser.js index 5a39ec45c..0daacfaa5 100644 --- a/core/modules/parsers/tiddlytextparser.js +++ b/core/modules/parsers/tiddlytextparser.js @@ -27,7 +27,7 @@ var TiddlyTextParser = function(options) { TiddlyTextParser.prototype.parse = function(type,text) { var output = [], dependencies = new $tw.Dependencies(), - macroRegExp = /(?:\[\[([^\]]+)\]\])|(?:<<(?:([!@£\$%\^\&\*\(\)`\~'"\|\\\/;\:\.\,\+\=\-\_\{\}])|([^>\s]+))(?:\s*)((?:[^>]|(?:>(?!>)))*)>>)/mg, + macroRegExp = /(?:\[\[([^\]]+)\]\])|(?:<<(?:([!@£\$%\^\&\*\(\)`\~'"\|\\\/;\:\.\,\+\=\-\_\{\}])|([^>\s]+))(?:\s*)((?:[^>]|(?:>(?!>)))*)>>((?:\r?\n)?))/mg, lastMatchPos = 0, match, macroNode; @@ -44,7 +44,8 @@ TiddlyTextParser.prototype.parse = function(type,text) { } else if(macroName) { // Macro call macroNode = $tw.Tree.Macro(macroName,{ srcParams: match[4], - wiki: this.wiki + wiki: this.wiki, + isBlock: !!match[5] }); } output.push(macroNode);