Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ckeditor/ckeditor5-code-block

Package Overview
Dependencies
Maintainers
1
Versions
696
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ckeditor/ckeditor5-code-block

Code block feature for CKEditor 5.

  • 0.0.0-nightly-20240923.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
275K
increased by7.43%
Maintainers
1
Weekly downloads
 
Created

What is @ckeditor/ckeditor5-code-block?

@ckeditor/ckeditor5-code-block is a plugin for CKEditor 5 that allows users to insert and manage code blocks within the editor. It provides syntax highlighting and formatting for various programming languages, making it easier to include and display code snippets in content.

What are @ckeditor/ckeditor5-code-block's main functionalities?

Inserting Code Blocks

This feature allows users to insert code blocks into the editor. The code sample demonstrates how to configure CKEditor 5 to include the CodeBlock plugin and add a button to the toolbar for inserting code blocks.

ClassicEditor.create(document.querySelector('#editor'), { plugins: [CodeBlock], toolbar: ['codeBlock'] })

Syntax Highlighting

This feature provides syntax highlighting for different programming languages. The code sample shows how to configure the CodeBlock plugin to support JavaScript and Python syntax highlighting.

ClassicEditor.create(document.querySelector('#editor'), { plugins: [CodeBlock], codeBlock: { languages: [ { language: 'javascript', label: 'JavaScript' }, { language: 'python', label: 'Python' } ] } })

Customizing Code Block Styles

This feature allows users to customize the styles of code blocks. The code sample demonstrates how to configure the CodeBlock plugin to apply custom CSS classes to code blocks.

ClassicEditor.create(document.querySelector('#editor'), { plugins: [CodeBlock], codeBlock: { styles: [ { element: 'pre', classes: ['custom-code-block'] } ] } })

Other packages similar to @ckeditor/ckeditor5-code-block

Keywords

FAQs

Package last updated on 23 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc