Skip to content

A package which adds a code-block feature to the WYSIWYG editor CKEditor 5

Notifications You must be signed in to change notification settings

MCFreddie777/ckeditor5-code-block

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 ckeditor/ckeditor5#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

About

A package which adds a code-block feature to the WYSIWYG editor CKEditor 5

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published