From: Alexander Ebert Date: Fri, 14 Aug 2015 15:57:15 +0000 (+0200) Subject: Fixed weird newlines showing up when pasting from Microsoft Word X-Git-Tag: 2.1.7~29 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e4ff4622abb8a6dfe221ac2eeff0e99297dd1dff;p=GitHub%2FWoltLab%2FWCF.git Fixed weird newlines showing up when pasting from Microsoft Word --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js index fb0bad1d7d..89c1b6aaff 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js @@ -1552,6 +1552,11 @@ RedactorPlugins.wbbcode = function() { }); html = html.replace(/<\/h[1-6]>/g, '[/size]'); + // fix weird newlines found when pasting from Microsoft Word + if (/

/.test(html)) { + html = html.replace(/([^>\s])\n([^<\s])/g, '$1 $2'); + } + // fix empty paragraphs when pasting from Microsoft Word html = html.replace(/ <\/o:p>/g, '
');