1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-02-09 15:40:03 +00:00

Unquoted parameters should not eat a succeeding comma

Fixes #6672
This commit is contained in:
jeremy@jermolene.com 2022-05-02 13:49:41 +01:00
parent a10106a4a6
commit a888cd57cd
3 changed files with 4 additions and 4 deletions

View File

@ -40,7 +40,7 @@ exports.parse = function() {
var paramString = this.match[3], var paramString = this.match[3],
params = []; params = [];
if(this.match[2]) { if(this.match[2]) {
var reParam = /\s*([^:),\s]+)(?:\s*:\s*(?:"""([\s\S]*?)"""|"([^"]*)"|'([^']*)'|([^"'\s]+)))?/mg, var reParam = /\s*([^:),\s]+)(?:\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

View File

@ -39,7 +39,7 @@ exports.parse = function() {
var paramString = this.match[1], var paramString = this.match[1],
attributes = Object.create(null), attributes = Object.create(null),
orderedAttributes = [], orderedAttributes = [],
reParam = /\s*([^:),\s]+)(?:\s*:\s*(?:"""([\s\S]*?)"""|"([^"]*)"|'([^']*)'|([^"'\s]+)))?/mg, reParam = /\s*([^:),\s]+)(?:\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

View File

@ -15,13 +15,13 @@ _
title: TiddlerOne title: TiddlerOne
\whitespace trim \whitespace trim
\parameters(zero:'Jaguar',one:'Lizard',two:'Mole') \parameters(zero:Jaguar,one:'Lizard',two:'Mole')
[{<$text text=<<zero>>/>}{<$text text=<<one>>/>}{<$text text=<<two>>/>}] [{<$text text=<<zero>>/>}{<$text text=<<one>>/>}{<$text text=<<two>>/>}]
_ _
title: TiddlerTwo title: TiddlerTwo
\whitespace trim \whitespace trim
\parameters(zero:'Mouse',one:'Horse',two:'Owl') \parameters(zero:'Mouse',one:Horse,two:'Owl')
(<$transclude $tiddler=<<currentTiddler>> zero=<<zero>> one=<<one>> two=<<two>>/>) (<$transclude $tiddler=<<currentTiddler>> zero=<<zero>> one=<<one>> two=<<two>>/>)
_ _
title: ExpectedResult title: ExpectedResult