var mpOnSet = this.clean.onSet;
this.clean.onSet = (function (html) {
- return mpOnSet.call(this, html.replace(/\u200B/g, ''));
+ html = html.replace(/\u200B/g, '');
+
+ // fix ampersands being replaced
+ html = html.replace(/&/g, '@@@WCF_AMPERSAND@@@');
+
+ html = mpOnSet.call(this, html);
+
+ // restore ampersands
+ html = html.replace(/@@@WCF_AMPERSAND@@@/g, '&');
+
+ return html;
}).bind(this);
var mpOnSync = this.clean.onSync;
var div = elCreate('div');
var replacements = {};
+ // fix ampersands being replaced
+ html = html.replace(/&/g, '@@@WCF_AMPERSAND@@@');
+
if (html.indexOf('<pre') !== -1) {
div.innerHTML = html;
html = mpOnSync.call(this, html);
+ // restore ampersands
+ html = html.replace(/@@@WCF_AMPERSAND@@@/g, '&');
+
div.innerHTML = html;
elBySelAll('span', div, function (span) {