1 Answers
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.
CKEditor
CKSource Holding LtdDisclaimer
Techjockey’s software industry experts offer advice for educational and informational purposes only. A category or product query or issue posted, created, or compiled by Techjockey is not meant to replace your independent judgment.
20,000+ Software Listed
Best
Price Guaranteed
Free Expert
Consultation
2M+
Happy Customers