From 75ff9fb6c02ac693ac7a810d9cb1afaeb32776aa Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sat, 22 Feb 2014 08:43:03 +0000 Subject: [PATCH] Allow the end of text to be treated as a linebreak for parsing HTML tags --- core/modules/parsers/wikiparser/rules/html.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/modules/parsers/wikiparser/rules/html.js b/core/modules/parsers/wikiparser/rules/html.js index f0d6aef92..3feac5f06 100644 --- a/core/modules/parsers/wikiparser/rules/html.js +++ b/core/modules/parsers/wikiparser/rules/html.js @@ -48,7 +48,7 @@ exports.parse = function() { // Advance the parser position to past the tag this.parser.pos = tag.end; // Check for an immediately following double linebreak - var hasLineBreak = !tag.isSelfClosing && !!this.parseTokenRegExp(this.parser.source,this.parser.pos,/(\r?\n\r?\n)/g); + var hasLineBreak = !tag.isSelfClosing && !!this.parseTokenRegExp(this.parser.source,this.parser.pos,/(\r?\n(?:\r?\n|$))/g); // Set whether we're in block mode tag.isBlock = this.is.block || hasLineBreak; // Parse the body if we need to @@ -359,7 +359,7 @@ exports.parseTag = function(source,pos,options) { pos = token.end; // Check for a required line break if(options.requireLineBreak) { - token = this.parseTokenRegExp(source,pos,/(\r?\n\r?\n)/g); + token = this.parseTokenRegExp(source,pos,/(\r?\n(?:\r?\n|$))/g); if(!token) { return null; }