diff --git a/src/components/Form/fields/FieldRichText.vue b/src/components/Form/fields/FieldRichText.vue index 40ccd76f2..2d3938bb6 100644 --- a/src/components/Form/fields/FieldRichText.vue +++ b/src/components/Form/fields/FieldRichText.vue @@ -10,6 +10,7 @@ export default { type: String, required: true, }, + /** Must be `oneline`. */ size: { type: String, @@ -20,6 +21,24 @@ export default { return ['oneline'].includes(value); }, }, + + // @see 5.0+ : https://www.tiny.cloud/docs/configure/content-filtering/#invalid_elements + // @see 6.0+ : https://www.tiny.cloud/docs/tinymce/latest/content-filtering/#invalid_elements + invalidElements: { + type: String, + default() { + return 'em,strong,br'; + }, + }, + + // @see 5.0+ : https://www.tiny.cloud/docs/configure/content-filtering/#valid_elements + // @see 6.0+ : https://www.tiny.cloud/docs/tinymce/latest/content-filtering/#valid_elements + validElements: { + type: String, + default() { + return 'b,i,u,sup,sub'; + }, + }, }, computed: { /** @@ -58,14 +77,10 @@ export default { subscript: [{inline: 'sub', remove: 'all', exact: true}], superscript: [{inline: 'sup', remove: 'all', exact: true}], }, - extended_valid_elements: 'b,i', - invalid_elements: 'em strong', - // Allow pasting while stripping all styles, tags, new lines and getting only text content - // More details at https://www.tiny.cloud/docs/tinymce/6/copy-and-paste/ - paste_preprocess: (editor, args) => { - args.content = $('