From 18cd6625b586c4915432d0b7315162626b44ebbf Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 23 May 2016 12:49:28 +0200 Subject: [PATCH] Preserve literal ` ` --- .../install/files/js/3rdParty/redactor/plugins/wbbcode.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js index fc68b1fbe3..3472b31dd1 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js @@ -433,7 +433,6 @@ RedactorPlugins.wbbcode = function() { // drop
, they are pointless because the editor already adds a newline after them html = html.replace(/
/g, ''); - html = html.replace(/ /gi, " "); // [quote] html = html.replace(/]+)>\n?]*?>[\s\S]*?<\/header>/gi, function(match, attributes, innerContent) { @@ -1505,6 +1504,9 @@ RedactorPlugins.wbbcode = function() { 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;'); + return data; }, -- 2.20.1