1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-12-10 02:38:06 +00:00

Add support for named end markers for procedures, functions and widgets

This commit is contained in:
jeremy@jermolene.com
2022-11-23 16:30:20 +00:00
parent b78f8769a9
commit 52592a4dbc
5 changed files with 44 additions and 4 deletions

View File

@@ -53,7 +53,7 @@ exports.parse = function() {
var reEnd;
if(this.match[5]) {
// If so, the end of the body is marked with \end
reEnd = /(\r?\n\\end[^\S\n\r]*(?:$|\r?\n))/mg;
reEnd = new RegExp("(\\r?\\n\\\\end[^\\S\\n\\r]*(?:" + $tw.utils.escapeRegExp(this.match[2]) + ")?(?:$|\\r?\\n))","mg");
} else {
// Otherwise, the end of the definition is marked by the end of the line
reEnd = /($|\r?\n)/mg;