diff --git a/core/modules/parsers/parseutils.js b/core/modules/parsers/parseutils.js index baf1f93bf..d64759065 100644 --- a/core/modules/parsers/parseutils.js +++ b/core/modules/parsers/parseutils.js @@ -99,11 +99,13 @@ exports.parseStringLiteral = function(source,pos) { type: "string", start: pos }; - var reString = /(?:"([^"]*)")|(?:'([^']*)')/g; + var reString = /(?:"""([\s\S]*?)"""|"([^"]*)")|(?:'([^']*)')/g; reString.lastIndex = pos; var match = reString.exec(source); if(match && match.index === pos) { - node.value = match[1] === undefined ? match[2] : match[1]; + node.value = match[1] !== undefined ? match[1] :( + match[2] !== undefined ? match[2] : match[3] + ); node.end = pos + match[0].length; return node; } else { @@ -134,7 +136,9 @@ exports.parseMacroParameter = function(source,pos) { token.match[3] !== undefined ? token.match[3] : ( token.match[4] !== undefined ? token.match[4] : ( token.match[5] !== undefined ? token.match[5] : ( - "" + token.match[6] !== undefined ? token.match[6] : ( + "" + ) ) ) ) diff --git a/core/modules/parsers/wikiparser/rules/macrocallblock.js b/core/modules/parsers/wikiparser/rules/macrocallblock.js index 2a23ed777..d99c15a6c 100644 --- a/core/modules/parsers/wikiparser/rules/macrocallblock.js +++ b/core/modules/parsers/wikiparser/rules/macrocallblock.js @@ -35,12 +35,12 @@ exports.parse = function() { // Move past the macro call this.parser.pos = this.matchRegExp.lastIndex; var params = [], - reParam = /\s*(?:([A-Za-z0-9\-_]+)\s*:)?(?:\s*(?:"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|([^"'\s]+)))/mg, + reParam = /\s*(?:([A-Za-z0-9\-_]+)\s*:)?(?:\s*(?:"""([\s\S]*?)"""|"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|([^"'\s]+)))/mg, paramMatch = reParam.exec(paramString); while(paramMatch) { // Process this parameter var paramInfo = { - value: paramMatch[2] || paramMatch[3] || paramMatch[4] || paramMatch[5] + value: paramMatch[2] || paramMatch[3] || paramMatch[4] || paramMatch[5] || paramMatch[6] }; if(paramMatch[1]) { paramInfo.name = paramMatch[1]; diff --git a/core/modules/parsers/wikiparser/rules/macrocallinline.js b/core/modules/parsers/wikiparser/rules/macrocallinline.js index 54b953339..6e96d45b7 100644 --- a/core/modules/parsers/wikiparser/rules/macrocallinline.js +++ b/core/modules/parsers/wikiparser/rules/macrocallinline.js @@ -35,12 +35,12 @@ exports.parse = function() { // Move past the macro call this.parser.pos = this.matchRegExp.lastIndex; var params = [], - reParam = /\s*(?:([A-Za-z0-9\-_]+)\s*:)?(?:\s*(?:"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|([^"'\s]+)))/mg, + reParam = /\s*(?:([A-Za-z0-9\-_]+)\s*:)?(?:\s*(?:"""([\s\S]*?)"""|"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|([^"'\s]+)))/mg, paramMatch = reParam.exec(paramString); while(paramMatch) { // Process this parameter var paramInfo = { - value: paramMatch[2] || paramMatch[3] || paramMatch[4] || paramMatch[5] + value: paramMatch[2] || paramMatch[3] || paramMatch[4] || paramMatch[5]|| paramMatch[6] }; if(paramMatch[1]) { paramInfo.name = paramMatch[1]; diff --git a/core/modules/parsers/wikiparser/rules/macrodef.js b/core/modules/parsers/wikiparser/rules/macrodef.js index fa91c50a6..7c4094b96 100644 --- a/core/modules/parsers/wikiparser/rules/macrodef.js +++ b/core/modules/parsers/wikiparser/rules/macrodef.js @@ -40,12 +40,12 @@ exports.parse = function() { var paramString = this.match[2], params = []; if(paramString !== "") { - var reParam = /\s*([A-Za-z0-9\-_]+)(?:\s*:\s*(?:"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|([^"'\s]+)))?/mg, + var reParam = /\s*([A-Za-z0-9\-_]+)(?:\s*:\s*(?:"""([\s\S]*?)"""|"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|([^"'\s]+)))?/mg, paramMatch = reParam.exec(paramString); while(paramMatch) { // Save the parameter details var paramInfo = {name: paramMatch[1]}, - defaultValue = paramMatch[2] || paramMatch[3] || paramMatch[4] || paramMatch[5]; + defaultValue = paramMatch[2] || paramMatch[3] || paramMatch[4] || paramMatch[5] || paramMatch[6]; if(defaultValue) { paramInfo["default"] = defaultValue; }