mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-10-04 23:21:42 +00:00
Allow single closing square brackets within double square brackets quoted strings
This commit is contained in:
@@ -107,7 +107,7 @@ exports.parseStringLiteral = function(source,pos) {
|
|||||||
type: "string",
|
type: "string",
|
||||||
start: pos
|
start: pos
|
||||||
};
|
};
|
||||||
var reString = /(?:"""([\s\S]*?)"""|"([^"]*)")|(?:'([^']*)')|\[\[([^\]]*)\]\]/g;
|
var reString = /(?:"""([\s\S]*?)"""|"([^"]*)")|(?:'([^']*)')|\[\[((?:[^\]]|\](?!\]))*)\]\]/g;
|
||||||
reString.lastIndex = pos;
|
reString.lastIndex = pos;
|
||||||
var match = reString.exec(source);
|
var match = reString.exec(source);
|
||||||
if(match && match.index === pos) {
|
if(match && match.index === pos) {
|
||||||
@@ -174,7 +174,7 @@ exports.parseMacroParameter = function(source,pos) {
|
|||||||
start: pos
|
start: pos
|
||||||
};
|
};
|
||||||
// Define our regexp
|
// Define our regexp
|
||||||
const reMacroParameter = /(?:([A-Za-z0-9\-_]+)\s*:)?(?:\s*(?:"""([\s\S]*?)"""|"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|((?:(?:>(?!>))|[^\s>"'])+)))/y;
|
const reMacroParameter = /(?:([A-Za-z0-9\-_]+)\s*:)?(?:\s*(?:"""([\s\S]*?)"""|"([^"]*)"|'([^']*)'|\[\[((?:[^\]]|\](?!\]))*)\]\]|((?:(?:>(?!>))|[^\s>"'])+)))/y;
|
||||||
// Skip whitespace
|
// Skip whitespace
|
||||||
pos = $tw.utils.skipWhiteSpace(source,pos);
|
pos = $tw.utils.skipWhiteSpace(source,pos);
|
||||||
// Look for the parameter
|
// Look for the parameter
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ exports.parse = function() {
|
|||||||
var paramString = this.match[2],
|
var paramString = this.match[2],
|
||||||
params = [];
|
params = [];
|
||||||
if(paramString !== "") {
|
if(paramString !== "") {
|
||||||
var reParam = /\s*([A-Za-z0-9\-_]+)(?:\s*:\s*(?:"""([\s\S]*?)"""|"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|([^"'\s]+)))?/mg,
|
var reParam = /\s*([A-Za-z0-9\-_]+)(?:\s*:\s*(?:"""([\s\S]*?)"""|"([^"]*)"|'([^']*)'|\[\[((?:[^\]]|\](?!\]))*)\]\]|([^"'\s]+)))?/mg,
|
||||||
paramMatch = reParam.exec(paramString);
|
paramMatch = reParam.exec(paramString);
|
||||||
while(paramMatch) {
|
while(paramMatch) {
|
||||||
// Save the parameter details
|
// Save the parameter details
|
||||||
|
|||||||
Reference in New Issue
Block a user