Preserving special characters during conversion HTML -> BBCode
authorAlexander Ebert <ebert@woltlab.com>
Tue, 26 Aug 2014 15:09:26 +0000 (17:09 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 26 Aug 2014 15:09:26 +0000 (17:09 +0200)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js

index 43e9c4272a0220421e8a5485bdba407dbd22fc76..6807649af6aa2bb3bc05072cec69f007129159e7 100644 (file)
@@ -170,6 +170,13 @@ RedactorPlugins.wbbcode = {
                
                WCF.System.Event.fireEvent('com.woltlab.wcf.redactor', 'beforeConvertFromHtml', { html: html });
                
+               // revert conversion of special characters
+               html = html.replace(/&trade;/gi, '\u2122');
+               html = html.replace(/&copy;/gi, '\u00a9');
+               html = html.replace(/&hellip;/gi, '\u2026');
+               html = html.replace(/&mdash;/gi, '\u2014');
+               html = html.replace(/&dash;/gi, '\u2010');
+               
                // drop all new lines
                html = html.replace(/\r?\n/g, '');