From ea7199600d2e1f959037625f82128580aad8efa0 Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Mon, 2 May 2022 10:56:09 +0100 Subject: [PATCH] Be as permissive as possible with parameter names Previously restricted to upper and lower case, digits and dash and underscore --- core/modules/parsers/wikiparser/rules/functiondef.js | 2 +- core/modules/parsers/wikiparser/rules/parameters.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/modules/parsers/wikiparser/rules/functiondef.js b/core/modules/parsers/wikiparser/rules/functiondef.js index 9e748ef48..1320cc004 100644 --- a/core/modules/parsers/wikiparser/rules/functiondef.js +++ b/core/modules/parsers/wikiparser/rules/functiondef.js @@ -40,7 +40,7 @@ exports.parse = function() { var paramString = this.match[3], params = []; if(this.match[2]) { - var reParam = /\s*([A-Za-z0-9\-_]+)(?:\s*:\s*(?:"""([\s\S]*?)"""|"([^"]*)"|'([^']*)'|([^"'\s]+)))?/mg, + var reParam = /\s*([^:)\s]+)(?:\s*:\s*(?:"""([\s\S]*?)"""|"([^"]*)"|'([^']*)'|([^"'\s]+)))?/mg, paramMatch = reParam.exec(paramString); while(paramMatch) { // Save the parameter details diff --git a/core/modules/parsers/wikiparser/rules/parameters.js b/core/modules/parsers/wikiparser/rules/parameters.js index 93001c8e5..567ac9b83 100644 --- a/core/modules/parsers/wikiparser/rules/parameters.js +++ b/core/modules/parsers/wikiparser/rules/parameters.js @@ -39,7 +39,7 @@ exports.parse = function() { var paramString = this.match[1], attributes = Object.create(null), orderedAttributes = [], - reParam = /\s*([A-Za-z0-9\-_]+)(?:\s*:\s*(?:"""([\s\S]*?)"""|"([^"]*)"|'([^']*)'|([^"'\s]+)))?/mg, + reParam = /\s*([^:)\s]+)(?:\s*:\s*(?:"""([\s\S]*?)"""|"([^"]*)"|'([^']*)'|([^"'\s]+)))?/mg, paramMatch = reParam.exec(paramString); while(paramMatch) { // Save the parameter details