From 370fb607c8ab05a075fa62f50cf1d0839616095c Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Fri, 29 Jun 2012 23:05:06 +0200 Subject: [PATCH 1/2] Insert separation between adjacent pres Change-Id: I55aa649b4e076cae32b3c970d6384ab2ed4cdd6c --- modules/parser/mediawiki.WikitextSerializer.js | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/parser/mediawiki.WikitextSerializer.js b/modules/parser/mediawiki.WikitextSerializer.js index f51c6373bb..ed5e68aaaf 100644 --- a/modules/parser/mediawiki.WikitextSerializer.js +++ b/modules/parser/mediawiki.WikitextSerializer.js @@ -652,6 +652,7 @@ WSP.tagHandlers = { pre: { start: { startsNewline: true, + pairSepNLCount: 2, handle: function( state, token ) { state.inIndentPre = true; state.textHandler = function( t ) { From cf7f43796624412ef8b820bdc513139044fc8bec Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Fri, 29 Jun 2012 23:15:30 +0200 Subject: [PATCH 2/2] Match named entities with up to eight chars The longest entries in http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references. Change-Id: I2c9f102fe6a905e339e12520d08c1b1b0a4002d8 --- modules/parser/mediawiki.WikitextSerializer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/parser/mediawiki.WikitextSerializer.js b/modules/parser/mediawiki.WikitextSerializer.js index ed5e68aaaf..af7b4f92c7 100644 --- a/modules/parser/mediawiki.WikitextSerializer.js +++ b/modules/parser/mediawiki.WikitextSerializer.js @@ -191,7 +191,7 @@ WSP.escapeWikiText = function ( state, text ) { // modified for now. outTexts.push( token.dataAttribs.src // escape ampersands in entity text - .replace(/&(#?[0-9a-zA-Z]{2,6};)/, '&$1') ); + .replace(/&(#?[0-9a-zA-Z]{2,8};)/, '&$1') ); // skip generated tokens for ( ; i < l; i ++) { var tk = tokens[i];