Disable syntax highlighting for CDATA


I use Atom editor and I have a template files with nested HTML in CDATA tag, so all HTML code is like 1 color.

Is possible to “ignore” CDATA? I want HTML syntax highlighting in that CDATA (see example). I cannot remove that CDATA because of template engine.


<?xml version="1.0" encoding="UTF-8"?>

    <entity id="main"><![CDATA[
         <div>LOT OF HTML CODE HERE</div>  


Thank you


What language is active for these files?


its HTML syntax highlighting


Does the template engine use any other tags? Is there some online documentation about the template engine?


It is Template Toolkit (Perl) but I use Cyclone 3 framework.


So is it possible?

For example WebStorm works out of the box.

It just “ignore” CDATA tag


It’s possible. It just requires a language package that matches for the template-specific tags and then includes the HTML grammar for everything else, like this one.


I quite don’t understand that your code. Literally everything what I need is to highlight that file as HTML syntax, but if there will be <![CDATA[ just ignore it (skip).


Yes, but in order to skip it, you have to have the language package highlight it. It doesn’t have to have a color (you can give it a class name that your theme doesn’t include), but it has to be matched by Atom’s grammar.


So what I have to do? Because I have no skills with creating language packages.


The example I’ve provided is easy enough to tweak. Or you can post a complete description of all the rules and wait until someone else has time to write one.


There is no rules, I just want same syntax highlighting as HTML (copy paste) but only difference is that it should skip tag CDATA (for example it should be white color), like in that picture of Webstorm.


Then why did you say that it was Template Toolkit? I looked that up and it has a bunch of rules, none of which involve a CDATA keyword.

Anyway, the language package is here. Don’t download it directly into .atom/packages. Instead, you should clone or unzip it in your project folder and use the command line instruction apm link inside the language-no-cdata folder.


Thank you very much :slight_smile: