From 43aeb47fc34f1ba424030c4f78ee907fe7b1d5d8 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Thu, 28 Aug 2014 20:21:09 +0100 Subject: [PATCH] Skip whitespace from start of inline macro definitions Now `\define mymacro() yes` will not have a leading space in the variable value --- core/modules/parsers/wikiparser/rules/macrodef.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/modules/parsers/wikiparser/rules/macrodef.js b/core/modules/parsers/wikiparser/rules/macrodef.js index a57e62c37..819e9fe25 100644 --- a/core/modules/parsers/wikiparser/rules/macrodef.js +++ b/core/modules/parsers/wikiparser/rules/macrodef.js @@ -62,6 +62,8 @@ exports.parse = function() { } else { // Otherwise, the end of the definition is marked by the end of the line reEnd = /(\r?\n)/mg; + // Move past any whitespace + this.parser.pos = $tw.utils.skipWhiteSpace(this.parser.source,this.parser.pos); } // Find the end of the definition reEnd.lastIndex = this.parser.pos;