# CKEditor change config in Mautic 5 to allow all html

**URL:** <https://forum.mautic.org/t/ckeditor-change-config-in-mautic-5-to-allow-all-html/34756>\
**Category:** Product Support\
**Created:** [January 15, 2025, 11:21am UTC](https://forum.mautic.org/t/ckeditor-change-config-in-mautic-5-to-allow-all-html/34756 "2025-01-15T11:21:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stevenx](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/stevenx/32/13541_2.png) [@stevenx](https://forum.mautic.org/u/stevenx)\
**Post date:** [January 15, 2025, 11:21am UTC](https://forum.mautic.org/t/ckeditor-change-config-in-mautic-5-to-allow-all-html/34756/1 "2025-01-15T11:21:45Z")

</div>

Hi, want to change the CKEditor in Dynamic Content.  
I have some custom HTML which gets filtert in current CKEditor if I switch from source view to normal view.

I simply want to add this to config, which would sove the issue:

htmlSupport: {  
allow: [  
{  
name: /.\*/,  
attributes: true,  
classes: true,  
styles: true  
}  
]  
},

---

<div class="post-metadata">

**Author:** ![stevenx](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/stevenx/32/13541_2.png) [@stevenx](https://forum.mautic.org/u/stevenx)\
**Post date:** [January 17, 2025, 8:46am UTC](https://forum.mautic.org/t/ckeditor-change-config-in-mautic-5-to-allow-all-html/34756/2 "2025-01-17T08:46:32Z")

</div>

Just add this in  
app/assets/libraries/ckeditor/src/ckeditor.ts  
and compile the js again  
ddev exec npm run build  
clear cache  
ddev exec php bin/console cache:clear  
and warm the cache  
ddev exec php bin/console cache:warmup

voila, it works 🙂  
/\*\*

- @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o.
- All rights reserved. For licensing, see LICENSE.md or [CKEditor Licensing](https://ckeditor.com/legal/ckeditor-oss-license)  
\*/

// The editor creator to use.  
import { ClassicEditor as ClassicEditorBase } from ‘@ckeditor/ckeditor5-editor-classic’;  
import { Essentials } from ‘@ckeditor/ckeditor5-essentials’;  
import { CKFinderUploadAdapter } from ‘@ckeditor/ckeditor5-adapter-ckfinder’;  
import { Autoformat } from ‘@ckeditor/ckeditor5-autoformat’;  
import { Bold, Italic, Underline, Code, Strikethrough, Subscript, Superscript } from ‘@ckeditor/ckeditor5-basic-styles’;  
import { BlockQuote } from ‘@ckeditor/ckeditor5-block-quote’;  
import { CKBox } from ‘@ckeditor/ckeditor5-ckbox’;  
import { CKFinder } from ‘@ckeditor/ckeditor5-ckfinder’;  
import { EasyImage } from ‘@ckeditor/ckeditor5-easy-image’;  
import { Heading } from ‘@ckeditor/ckeditor5-heading’;  
import { Image, ImageCaption, ImageInsert, ImageResize, ImageStyle, ImageToolbar, ImageUpload, PictureEditing, AutoImage, ImageBlock, ImageInline } from ‘@ckeditor/ckeditor5-image’;  
import { FontBackgroundColor, FontColor, FontFamily, FontSize } from “@ckeditor/ckeditor5-font”;  
import { Indent, IndentBlock } from ‘@ckeditor/ckeditor5-indent’;  
import { Link, AutoLink, LinkImage } from ‘@ckeditor/ckeditor5-link’;  
import { Autosave } from “@ckeditor/ckeditor5-autosave”;  
import { List } from ‘@ckeditor/ckeditor5-list’;  
import { MediaEmbed } from ‘@ckeditor/ckeditor5-media-embed’;  
import { Paragraph } from ‘@ckeditor/ckeditor5-paragraph’;  
import { PasteFromOffice } from ‘@ckeditor/ckeditor5-paste-from-office’;  
import { Table, TableCellProperties, TableProperties, TableToolbar } from ‘@ckeditor/ckeditor5-table’;  
import { TextTransformation } from ‘@ckeditor/ckeditor5-typing’;  
import { CloudServices } from ‘@ckeditor/ckeditor5-cloud-services’;  
import { Alignment } from “@ckeditor/ckeditor5-alignment”;  
import { RemoveFormat } from “@ckeditor/ckeditor5-remove-format”;  
import { SourceEditing } from “@ckeditor/ckeditor5-source-editing”;  
import { GeneralHtmlSupport } from “@ckeditor/ckeditor5-html-support”; // Import the plugin  
import { Mention } from “@ckeditor/ckeditor5-mention”;  
import TokenPlugin from ‘./TokenPlugin’;

export default class ClassicEditor extends ClassicEditorBase {  
public static override builtinPlugins = [  
ImageInsert,  
IndentBlock,  
ImageInline,  
Superscript,  
ImageBlock,  
TableProperties,  
TableCellProperties,  
Subscript,  
Strikethrough,  
Mention,  
LinkImage,  
ImageResize,  
Alignment,  
Code,  
AutoImage,  
AutoLink,  
Autosave,  
FontBackgroundColor,  
RemoveFormat,  
SourceEditing,  
GeneralHtmlSupport, // Add the plugin here  
TokenPlugin,  
FontColor,  
FontFamily,  
FontSize,  
Essentials,  
Underline,  
CKFinderUploadAdapter,  
Autoformat,  
Bold,  
Italic,  
BlockQuote,  
CKBox,  
CKFinder,  
CloudServices,  
EasyImage,  
Heading,  
Image,  
ImageCaption,  
ImageStyle,  
ImageToolbar,  
ImageUpload,  
Indent,  
Link,  
List,  
MediaEmbed,  
Paragraph,  
PasteFromOffice,  
PictureEditing,  
Table,  
TableToolbar,  
TextTransformation  
];

```
public static override defaultConfig = {
    toolbar: {
        items: [
            'bold', 'italic', 'underline', 'code', 'strikethrough', 'subscript', 'superscript', '|',
            'heading', '|', 'alignment', 'link', 'bulletedList', 'numberedList', '|',
            'indent', 'outdent', '|', 'imageUpload', 'blockQuote', 'insertTable', 'mediaEmbed', '|',
            'undo', 'redo', 'sourceEditing'
        ]
    },
    htmlSupport: {
        allow: [
            {
                name: /.*/,
                attributes: true,
                classes: true,
                styles: true
            }
        ]
    },
    language: 'en',
    image: {
        toolbar: [
            'imageTextAlternative', 'imageStyle:full', 'imageStyle:side'
        ]
    },
    table: {
        contentToolbar: [
            'tableColumn', 'tableRow', 'mergeTableCells'
        ]
    }
};

```

}

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/1X/43c63600fe51440378769136903f1fa2a9a34102.png) [@system](https://forum.mautic.org/u/system)\
**Post date:** [January 18, 2025, 8:47pm UTC](https://forum.mautic.org/t/ckeditor-change-config-in-mautic-5-to-allow-all-html/34756/3 "2025-01-18T20:47:30Z")

</div>

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.
