convertFromHtml: function(html) {
var $searchFor = [ ];
- WCF.System.Event.fireEvent('com.woltlab.wcf.redactor', 'beforeConvertFromHtml', { html: html });
+ var parameters = { html: html };
+ WCF.System.Event.fireEvent('com.woltlab.wcf.redactor', 'beforeConvertFromHtml', parameters);
+ html = parameters.html;
// remove data-redactor-tag="" attribute
html = html.replace(/(<[^>]+?) data-redactor-tag="[^"]+"/g, '$1');
html = html.replace(/%28/g, '(');
html = html.replace(/%29/g, ')');
- WCF.System.Event.fireEvent('com.woltlab.wcf.redactor', 'afterConvertFromHtml', { html: html });
+ parameters = { html: html };
+ WCF.System.Event.fireEvent('com.woltlab.wcf.redactor', 'afterConvertFromHtml', parameters);
+ html = parameters.html;
// remove all leading and trailing whitespaces, but add one empty line at the end
html = $.trim(html);
* @param string data
*/
convertToHtml: function(data) {
- WCF.System.Event.fireEvent('com.woltlab.wcf.redactor', 'beforeConvertToHtml', { data: data });
+ var parameters = { data: data };
+ WCF.System.Event.fireEvent('com.woltlab.wcf.redactor', 'beforeConvertToHtml', parameters);
+ data = parameters.data;
// remove 0x200B (unicode zero width space)
data = this.wutil.removeZeroWidthSpace(data);
}
}
- WCF.System.Event.fireEvent('com.woltlab.wcf.redactor', 'afterConvertToHtml', { data: data });
-
// double-encode the ampersand, otherwise Redactor removes it
data = data.replace(/&nbsp;/g, '&amp;nbsp;');
+ parameters = { data: data };
+ WCF.System.Event.fireEvent('com.woltlab.wcf.redactor', 'afterConvertToHtml', parameters);
+ data = parameters.data;
+
return data;
},