skip to Main Content

I want to have JS syntax highlighting inside certain XML elements. E.g.

 <Module Name="Main">
<![CDATA[
   var obj = {};
   obj.car = { Name: 'car', HP: 135};
   obj.drive = function(car){...}
]]></Module>

This currently shows up as

image

Is there any extension that enables highlighting of the JS inside the element or do i have to do something custom?

I tried all kinds of XML extensions, none seem to have that integrated.

2

Answers


  1. Chosen as BEST ANSWER

    Made a small project, i will probably change it up a little bit but at its core it has JS syntax highlighting inside CDATA: https://github.com/Hrachkata/RCM-highlighter enter image description here


  2. You could try the extended-embedded-languages extension

    If not. Create a feature request to https://github.com/ruschaaf/extended-embedded-languages/issues

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search