diff --git a/packages/neos-ui-ckeditor5-bindings/src/cleanupContentBeforeCommit.spec.js b/packages/neos-ui-ckeditor5-bindings/src/cleanupContentBeforeCommit.spec.js index 8fcc51b1d0..08e5603a64 100644 --- a/packages/neos-ui-ckeditor5-bindings/src/cleanupContentBeforeCommit.spec.js +++ b/packages/neos-ui-ckeditor5-bindings/src/cleanupContentBeforeCommit.spec.js @@ -1,4 +1,4 @@ -import {cleanupContentBeforeCommit} from './cleanupContentBeforeCommit' +import {cleanupContentBeforeCommit} from './cleanupContentBeforeCommit'; const assertCleanedUpContent = (input, expected) => { expect(cleanupContentBeforeCommit(input)).toBe(expected); diff --git a/packages/neos-ui-ckeditor5-bindings/src/manifest.config.js b/packages/neos-ui-ckeditor5-bindings/src/manifest.config.js index c50b5fbc2b..718fe1399a 100644 --- a/packages/neos-ui-ckeditor5-bindings/src/manifest.config.js +++ b/packages/neos-ui-ckeditor5-bindings/src/manifest.config.js @@ -81,11 +81,18 @@ export default ckEditorRegistry => { // // Base CKE configuration + // - configuration of language + // - and placeholder feature see https://ckeditor.com/docs/ckeditor5/16.0.0/api/module_core_editor_editorconfig-EditorConfig.html#member-placeholder // - config.set('baseConfiguration', (ckEditorConfiguration, {userPreferences}) => { - return Object.assign(ckEditorConfiguration, { + config.set('baseConfiguration', (ckEditorConfiguration, {globalRegistry, editorOptions, userPreferences}) => { + const i18nRegistry = globalRegistry.get('i18n'); + const placeholder = $get('placeholder', editorOptions); + return { + ...ckEditorConfiguration, + // stripTags, because we allow `
Edit text here
` as placeholder for legacy + placeholder: placeholder ? stripTags(i18nRegistry.translate(placeholder)) : undefined, language: String($get('interfaceLanguage', userPreferences)) - }); + }; }); // @@ -144,21 +151,5 @@ export default ckEditorRegistry => { ]} })); - // - // @see https://ckeditor.com/docs/ckeditor5/16.0.0/api/module_core_editor_editorconfig-EditorConfig.html#member-placeholder - // - config.set('placeholder', (config, {globalRegistry, editorOptions}) => { - const i18nRegistry = globalRegistry.get('i18n'); - const placeholder = $get('placeholder', editorOptions); - if (!placeholder) { - return config; - } - return { - ...config, - // stripTags, because we allow `Edit text here
` as placeholder for legacy - placeholder: stripTags(i18nRegistry.translate(placeholder)) - }; - }); - return config; }; diff --git a/packages/neos-ui-ckeditor5-bindings/src/plugins/cleanupNeosInlineWrapper.js b/packages/neos-ui-ckeditor5-bindings/src/plugins/cleanupNeosInlineWrapper.js new file mode 100644 index 0000000000..24498ce2d1 --- /dev/null +++ b/packages/neos-ui-ckeditor5-bindings/src/plugins/cleanupNeosInlineWrapper.js @@ -0,0 +1,27 @@ +/** + * We remove opening and closing span tags that are produced by the inlineMode plugin + * + * @private only exported for testing + * @param {String} content + */ +export const cleanupNeosInlineWrapper = content => { + if (content.includes('