From 9d90c8fd78098d882541b96ac1cd08d720eb9e4c Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Sat, 26 May 2012 23:42:48 +0100 Subject: [PATCH] Ignore whitespace after the final block --- core/modules/parsers/newwikitextparser/newwikitextparser.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/modules/parsers/newwikitextparser/newwikitextparser.js b/core/modules/parsers/newwikitextparser/newwikitextparser.js index 5f9d08921..eac2c5575 100644 --- a/core/modules/parsers/newwikitextparser/newwikitextparser.js +++ b/core/modules/parsers/newwikitextparser/newwikitextparser.js @@ -41,6 +41,9 @@ Parse a block of text at the current position */ WikiTextRenderer.prototype.parseBlock = function() { this.skipWhitespace(); + if(this.pos >= this.sourceLength) { + return []; + } // Look for a block rule this.parser.blockRules.regExp.lastIndex = this.pos; var match = this.parser.blockRules.regExp.exec(this.source);