Last active
June 9, 2025 14:47
-
-
Save mike-moreau/2675ee4c4c14bd839216d6f77ee3875b to your computer and use it in GitHub Desktop.
Baseline Craft 5 CKEditor Field JSON Config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"htmlSupport": { | |
"allow": [ | |
{ | |
"attributes": true, | |
"classes": [ | |
"button", | |
"button-primary" | |
], | |
"name": "a" | |
} | |
] | |
}, | |
"alignment": { | |
"options": [ | |
"left", | |
"right", | |
"center" | |
] | |
}, | |
"list": { | |
"properties": { | |
"reversed": false, | |
"startIndex": false, | |
"styles": false | |
} | |
}, | |
"link": { | |
"addTargetToExternalLinks": false, | |
"decorators": { | |
"openInNewTab": { | |
"attributes": { | |
"rel": "noopener noreferrer", | |
"target": "_blank" | |
}, | |
"label": "Open in a new tab", | |
"mode": "manual" | |
} | |
} | |
} | |
} |
This example htmlSupport
is intentionally limited. A permissive setting would look like the following:
"htmlSupport": {
"allow": [
{
"attributes": true,
"classes": true,
"styles": true
}
]
},
Nice to see examples of other configs also https://gist.github.com/johnfmorton/4272cc5a8c3228816efde337cf54e06a
Here's a good article on configuration compared to redactor. Updated the example to include the links in a new tab option.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See CKEditor 5 config settings.