Having a trouble implement code blocks into CKEditor 5? So did I.
This package implements code block support for CKEditor 5.
I took the built-in blockquote plugin, and edited it - the result is a new feature - the code-block option in the toolbar, which saves the paragraph into <code>
element.
Feel free to submit issues and enhancement requests.
In ckeditor5-build-classic project:
npm install https://github.com/MCFreddie777/ckeditor5-code-block
Update src/ckeditor.js with:
import CodeBlock from '@mcfreddie777/ckeditor5-code-block/src/codeblock';
ClassicEditor.builtinPlugins = [
// ...
CodeBlock,
// ...
];
ClassicEditor.defaultConfig = {
toolbar: {
items: [
// ...
'codeBlock',
// ...
]
},
};
Then
npm run build