From: Alexander Ebert Date: Fri, 28 Jun 2013 11:24:01 +0000 (+0200) Subject: Properly handling pasted lists X-Git-Tag: 2.0.0_Beta_5~118^2~12 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ceea08704aa17aac37c28c8b9384f37b4a50db97;p=GitHub%2FWoltLab%2FWCF.git Properly handling pasted lists --- diff --git a/wcfsetup/install/files/js/3rdParty/ckeditor/plugins/wbbcode/plugin.js b/wcfsetup/install/files/js/3rdParty/ckeditor/plugins/wbbcode/plugin.js index 56febbf5e2..d4612dfd47 100644 --- a/wcfsetup/install/files/js/3rdParty/ckeditor/plugins/wbbcode/plugin.js +++ b/wcfsetup/install/files/js/3rdParty/ckeditor/plugins/wbbcode/plugin.js @@ -16,14 +16,21 @@ if (ev.data.type == 'html') { var $value = ev.data.dataValue; + console.debug("before:\n" + $value); + // Convert
to line breaks. $value = $value.replace(/
<\/p>/gi,"\n\n"); $value = $value.replace(/
/gi, "\n"); $value = $value.replace(/<\/p>/gi,"\n\n"); $value = $value.replace(/ /gi," "); + + // convert div-separated content into new lines $value = $value.replace(/])>/gi, ''); $value = $value.replace(/<\/div>/gi, "\n"); + // convert lists into new lines + $value = $value.replace(/<\/li>/gi, "\n"); + // remove html tags $value = $value.replace(/<[^>]+>/g, ''); @@ -32,6 +39,8 @@ ev.data.dataValue = $value; + console.debug("after:\n" + $value); + $pasted = true; } }, null, null, 9);