linkedin
  • Become a Seller

How to add source code format in ck editor?

Vikas Jagga . Oct 08, 2024

A:

To add source code formatting in CKEditor, follow the steps given below: 

Download the ‘Code Snippet plugin’ and extract it to the ‘plugins’ directory of CKEditor

Alter the

config.js

file by adding the ‘code snippet plugin’ to the ‘extra Plugins’ option:

Add a button for inserting code snippets in the toolbar:

Add the ‘Code Snippet CSS’ file in your HTML page to style the code by linking it to the

highlight.js

library used by the plugin:

Now, you should see the Code Snippet button in the toolbar, allowing you to insert formatted source code.

Oct 08, 2024

Was this helpful? upvote icon 0 downvote icon 0
img

Did not find the question you are looking for?

Get fast answers from real users and our software experts

menlaptop

Have a Question in Mind?

Get answers directly from verified users and our software experts

Software icon representing 20,000+ Software Listed 20,000+ Software Listed

Price tag icon for best price guarantee Best Price Guaranteed

Expert consultation icon Free Expert Consultation

Happy customer icon representing 2 million+ customers 2M+ Happy Customers