Question

I'm using HTML parser in Ace Editor. I'm looking for a way to add a set of custom tags and set a colour for them.

Tags look like this: {%HEADER%}, {%CONTENT%}, {%FOOTER%}.

Example code:

<html>
    <body>
        <h1>{%HEADER%}<h1>
        {%CONTENT%}
    </body>
</html>

Is there any way of doing this?

Was it helpful?

Solution

You need to create a new highlight mode for ace. See https://github.com/ajaxorg/ace/blob/master/lib/ace/mode/handlebars_highlight_rules.js for somewhat similar highlighter and http://ace.c9.io/#nav=higlighter for docs

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top