We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Is RTE have syntax highlighter?

Description

Currently we haven’t provided with in-built support for syntax highlighter in RTE. However, this can be achieved using some third party tools/plugins that will allow you to highlight the code blocks.

Solution

In below sample, we have used CodeMirror plugins to highlight HTML, Javascript and CSS using custom tool. Add the CodeMirror references to the script section as follows.

 

Javascript

 

Render the RTE control, use “customTool” options to add the “div” in the Toolbar.

 

Javascript

 

 

Upon click to the “div” element, the “Dialog” control will be open. From that insert any HTML, CSS or JavaScript syntax to the RTE.

The syntax has been inserted to the RTE using “executeCommand” method.

 

Javascript

 

Article ID: Published Date: Last Revised Date: Platform: Control:
7097 09/06/2016 09/06/2016 JavaScript ejRTE
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.