@hhlingyoko/ckeditor5-code-block

0.0.1 • Public • Published

CKEditor 5 Code-Block Feature

npm version

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.

See https://github.com/ckeditor/ckeditor5/issues/436

Issues

Feel free to submit issues and enhancement requests.

Usage

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

Package Sidebar

Install

npm i @hhlingyoko/ckeditor5-code-block

Homepage

ckeditor.com

Weekly Downloads

0

Version

0.0.1

License

GPL-2.0-or-later

Unpacked Size

38 kB

Total Files

52

Last publish

Collaborators

  • yokohu