mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-24 17:10:29 +00:00
Add block mode macros to tiddlytextparser
Which improves the whitespace handling for building TW2.6.x
This commit is contained in:
parent
a1c8ac624f
commit
9482717c94
@ -27,7 +27,7 @@ var TiddlyTextParser = function(options) {
|
|||||||
TiddlyTextParser.prototype.parse = function(type,text) {
|
TiddlyTextParser.prototype.parse = function(type,text) {
|
||||||
var output = [],
|
var output = [],
|
||||||
dependencies = new $tw.Dependencies(),
|
dependencies = new $tw.Dependencies(),
|
||||||
macroRegExp = /(?:\[\[([^\]]+)\]\])|(?:<<(?:([!@£\$%\^\&\*\(\)`\~'"\|\\\/;\:\.\,\+\=\-\_\{\}])|([^>\s]+))(?:\s*)((?:[^>]|(?:>(?!>)))*)>>)/mg,
|
macroRegExp = /(?:\[\[([^\]]+)\]\])|(?:<<(?:([!@£\$%\^\&\*\(\)`\~'"\|\\\/;\:\.\,\+\=\-\_\{\}])|([^>\s]+))(?:\s*)((?:[^>]|(?:>(?!>)))*)>>((?:\r?\n)?))/mg,
|
||||||
lastMatchPos = 0,
|
lastMatchPos = 0,
|
||||||
match,
|
match,
|
||||||
macroNode;
|
macroNode;
|
||||||
@ -44,7 +44,8 @@ TiddlyTextParser.prototype.parse = function(type,text) {
|
|||||||
} else if(macroName) { // Macro call
|
} else if(macroName) { // Macro call
|
||||||
macroNode = $tw.Tree.Macro(macroName,{
|
macroNode = $tw.Tree.Macro(macroName,{
|
||||||
srcParams: match[4],
|
srcParams: match[4],
|
||||||
wiki: this.wiki
|
wiki: this.wiki,
|
||||||
|
isBlock: !!match[5]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
output.push(macroNode);
|
output.push(macroNode);
|
||||||
|
Loading…
Reference in New Issue
Block a user