# Ace / Monaco: Custom syntax highlighter

**URL:** <https://discourse.nodered.org/t/ace-monaco-custom-syntax-highlighter/59070>\
**Category:** General\
**Tags:** monaco, editor\
**Created:** [27 February 2022 15:38 UTC](https://discourse.nodered.org/t/ace-monaco-custom-syntax-highlighter/59070 "2022-02-27T15:38:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)\
**Post date:** [27 February 2022 15:38 UTC](https://discourse.nodered.org/t/ace-monaco-custom-syntax-highlighter/59070/1 "2022-02-27T15:38:57Z")

</div>

I'm looking for a way to add a custom syntax highlighter to the Ace/Monaco editor.  
@knolleary stated a long time ago:

> [@How to add custom syntax checksum highlighting in the edit box](https://discourse.nodered.org/t/how-to-add-custom-syntax-checksum-highlighting-in-the-edit-box/13026/2):
>
> We only provide a subset of the default ace modes and there is no way to add in other ones. But we have discussed providing the whole lot (which includes graphqlschema) - so we can look at doing that in 1.0

Is there meanwhile an API or a hack to achieve this?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [27 February 2022 15:53 UTC](https://discourse.nodered.org/t/ace-monaco-custom-syntax-highlighter/59070/2 "2022-02-27T15:53:37Z")

</div>

> [@ralphwetzel](#):
>
> Is there meanwhile an API or a hack to achieve this

There is no official API so it would have to be a hack by accessing the built-in functions of the Monaco editor.

But, if we swap out the editor or Monaco changes its API your changes would fail.

Is it a completely custom syntax or an established syntax you require?

---

<div class="post-metadata">

**Author:** ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)\
**Post date:** [1 March 2022 07:16 UTC](https://discourse.nodered.org/t/ace-monaco-custom-syntax-highlighter/59070/3 "2022-03-01T07:16:34Z")

</div>

> [@Steve-Mcl](#):
>
> Is it a completely custom syntax or an established syntax you require?

A bit of both: A custom [template syntax](https://eta.js.org) to operate with css, html & javascript.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [1 March 2022 07:24 UTC](https://discourse.nodered.org/t/ace-monaco-custom-syntax-highlighter/59070/4 "2022-03-01T07:24:45Z")

</div>

Do you have a working syntax highlighter already?

---

<div class="post-metadata">

**Author:** ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)\
**Post date:** [1 March 2022 21:08 UTC](https://discourse.nodered.org/t/ace-monaco-custom-syntax-highlighter/59070/5 "2022-03-01T21:08:54Z")

</div>

Well... why do you ask?  
Are you going to spend time in creating one if it wasn't available? 😉

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [1 March 2022 21:31 UTC](https://discourse.nodered.org/t/ace-monaco-custom-syntax-highlighter/59070/6 "2022-03-01T21:31:13Z")

</div>

No, but I may have included it along side the other highlighters in the node-red repository.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [30 April 2022 21:31 UTC](https://discourse.nodered.org/t/ace-monaco-custom-syntax-highlighter/59070/7 "2022-04-30T21:31:46Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
