Escape ampersands in entities from plain text DOM content

Change-Id: I0826077cf48b67e38a525090be66411c38d7b65f
This commit is contained in:
Gabriel Wicke 2012-06-29 23:02:21 +02:00
parent 5874d9a5f1
commit 6c8dfa26fa

View file

@ -189,7 +189,9 @@ WSP.escapeWikiText = function ( state, text ) {
// push out the original source
// XXX: This assumes the content was not
// modified for now.
outTexts.push( token.dataAttribs.src );
outTexts.push( token.dataAttribs.src
// escape ampersands in entity text
.replace(/&(#?[0-9a-zA-Z]{2,6};)/, '&$1') );
// skip generated tokens
for ( ; i < l; i ++) {
var tk = tokens[i];