From ceea08704aa17aac37c28c8b9384f37b4a50db97 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 28 Jun 2013 13:24:01 +0200 Subject: [PATCH] Properly handling pasted lists --- .../files/js/3rdParty/ckeditor/plugins/wbbcode/plugin.js | 9 +++++++++ 1 file changed, 9 insertions(+) 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); -- 2.20.1