diff --git a/core/modules/parsers/wikiparser/rules/transcludeblock.js b/core/modules/parsers/wikiparser/rules/transcludeblock.js index c033c2440..a57646ff9 100644 --- a/core/modules/parsers/wikiparser/rules/transcludeblock.js +++ b/core/modules/parsers/wikiparser/rules/transcludeblock.js @@ -26,6 +26,27 @@ exports.init = function(parser) { this.matchRegExp = /\{\{([^\{\}\|]*)(?:\|\|([^\|\{\}]+))?(?:\|([^\{\}]+))?\}\}(?:\r?\n|$)/mg; }; +/* +Reject the match if we don't have a template or text reference +*/ +exports.findNextMatch = function(startPos) { + this.matchRegExp.lastIndex = startPos; + this.match = this.matchRegExp.exec(this.parser.source); + if(this.match) { + var template = $tw.utils.trim(this.match[2]), + textRef = $tw.utils.trim(this.match[1]); + // Bail if we don't have a template or text reference + if(!template && !textRef) { + return undefined; + } else { + return this.match.index; + } + } else { + return undefined; + } + return this.match ? this.match.index : undefined; +}; + exports.parse = function() { // Move past the match this.parser.pos = this.matchRegExp.lastIndex; diff --git a/core/modules/parsers/wikiparser/rules/transcludeinline.js b/core/modules/parsers/wikiparser/rules/transcludeinline.js index 3ce9dc78e..9ad4c0d90 100644 --- a/core/modules/parsers/wikiparser/rules/transcludeinline.js +++ b/core/modules/parsers/wikiparser/rules/transcludeinline.js @@ -26,6 +26,27 @@ exports.init = function(parser) { this.matchRegExp = /\{\{([^\{\}\|]*)(?:\|\|([^\|\{\}]+))?(?:\|([^\{\}]+))?\}\}/mg; }; +/* +Reject the match if we don't have a template or text reference +*/ +exports.findNextMatch = function(startPos) { + this.matchRegExp.lastIndex = startPos; + this.match = this.matchRegExp.exec(this.parser.source); + if(this.match) { + var template = $tw.utils.trim(this.match[2]), + textRef = $tw.utils.trim(this.match[1]); + // Bail if we don't have a template or text reference + if(!template && !textRef) { + return undefined; + } else { + return this.match.index; + } + } else { + return undefined; + } + return this.match ? this.match.index : undefined; +}; + exports.parse = function() { // Move past the match this.parser.pos = this.matchRegExp.lastIndex; diff --git a/editions/prerelease/tiddlers/system/TiddlyWiki Pre-release.tid b/editions/prerelease/tiddlers/system/TiddlyWiki Pre-release.tid index be4e4ff9b..9833839d5 100644 --- a/editions/prerelease/tiddlers/system/TiddlyWiki Pre-release.tid +++ b/editions/prerelease/tiddlers/system/TiddlyWiki Pre-release.tid @@ -1,6 +1,12 @@ title: TiddlyWiki Pre-release modified: 20230731122156493 +<$let currentTiddler="HelloThere"> + +<$button>{{}} + + + This is a pre-release build of TiddlyWiki provided for testing and review purposes. ''Please don't try to depend on the pre-release for anything important'' -- you should use the latest official release from https://tiddlywiki.com. All of the changes in this pre-release are provisional until it is released and they become frozen by our backwards compatibility policies. This is the perfect time to raise questions or make suggestions. Please [[open a ticket at GitHub|https://github.com/Jermolene/TiddlyWiki5/issues/new/choose]] or make a post at https://talk.tiddlywiki.org/. @@ -13,4 +19,5 @@ The pre-release is also available as an [[empty wiki|https://tiddlywiki.com/prer
Updated: <$view field="modified" format="date" template={{$:/language/Tiddler/DateFormat}}/>
<$transclude mode="block"/> +