Merge "Escape ampersands in entities from plain text DOM content"

This commit is contained in:
Gabriel Wicke 2012-06-29 21:11:23 +00:00 committed by Gerrit Code Review
commit da4a2e13d1

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];