// replace nested elements e.g. <div><p>...</p></div>
html = html.replace(/<(div|p)([^>]+)?><(div|p)([^>]+)?>/g, '<p>');
html = html.replace(/<\/(div|p)><\/(div|p)>/g, '</p>');
- html = html.replace(/<(div|p)><br><\/(div|p)>/g, '<p>');
+ //html = html.replace(/<(div|p)><br><\/(div|p)>/g, '<p>');
WCF.System.Event.fireEvent('com.woltlab.wcf.redactor', 'beforePaste', { html: html });
*/
_pasteCallback: function(html) {
// reduce successive <br> by one
- html = html.replace(/<br[^>]*>(<br[^>]*>)+/g, '$1');
+ //html = html.replace(/<br[^>]*>(<br[^>]*>)+/g, '$1');
// replace <p>...</p> with <p>...</p><p><br></p>
/*html = html.replace(/<p>([\s\S]*?)<\/p>/g, function(match, content) {
return $restoreSpecialCharacters(html);
}).bind(this);
+ // clean.onPasteRemoveEmpty
+ this.clean.onPasteRemoveEmpty = function(html) {
+ return html.replace(/<br\s?\/?>$/i, '');
+ };
+
// clean.onSet
var $mpOnSet = this.clean.onSet;
this.clean.onSet = (function(html) {