diff --git a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Plugins/softhyphen/plugin.js b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Plugins/softhyphen/plugin.js index ecb14b3cdcfb7421884acd7f65606d74f65ca342..ed719ab121aaf898053423b1796497df0a3f6a18 100644 --- a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Plugins/softhyphen/plugin.js +++ b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Plugins/softhyphen/plugin.js @@ -32,5 +32,21 @@ CKEDITOR.plugins.add("softhyphen", { toolbar: 'insertcharacters', icon: 'softhyphen' }); + }, + afterInit: function (editor) { + let dataProcessor = editor.dataProcessor, + htmlFilter = dataProcessor && dataProcessor.htmlFilter; + + if (htmlFilter) { + htmlFilter.addRules({ + text: function (text) { + // replace invisible Unicode character with HTML entity within source + return text.replace(new RegExp('­', 'g'), '\u00AD').replace(new RegExp('\u00AD', 'g'), '­'); + } + }, { + applyToAll: true, + excludeNestedEditable: false + }); + } } });