# About markdown syntax highlighter

**URL:** <https://discuss.elastic.co/t/about-markdown-syntax-highlighter/159628>\
**Category:** Meta Elastic\
**Created:** [December 6, 2018, 12:56am UTC](https://discuss.elastic.co/t/about-markdown-syntax-highlighter/159628 "2018-12-06T00:56:03Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)\
**Post date:** [December 6, 2018, 12:56am UTC](https://discuss.elastic.co/t/about-markdown-syntax-highlighter/159628/1 "2018-12-06T00:56:03Z")

</div>

Hi @system,

If I were to develop another markdown syntax highlighter (such as `json`, `http`, etc) would it be a [markdown-it](https://github.com/markdown-it/markdown-it) plugin such as [markdown-it-sub](https://github.com/markdown-it/markdown-it-sub)?

If not, can you please direct me where I could learn more about writing new markdown syntax highlighter?

Best

---

<div class="post-metadata">

**Author:** ![Sam\_Saffron](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sam_saffron/32/44937_2.png) [@Sam\_Saffron](https://discuss.elastic.co/u/Sam_Saffron)\
**Post date:** [December 6, 2018, 4:54am UTC](https://discuss.elastic.co/t/about-markdown-syntax-highlighter/159628/2 "2018-12-06T04:54:14Z")

</div>

Syntax highlighter would be neither 🙂

Have a look at: [https://highlightjs.org/](https://highlightjs.org/) we are on version 9.13.1

---

<div class="post-metadata">

**Author:** ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)\
**Post date:** [December 10, 2018, 6:33pm UTC](https://discuss.elastic.co/t/about-markdown-syntax-highlighter/159628/3 "2018-12-10T18:33:03Z")

</div>

Thanks @Sam_Saffron!

I've sent a PR to highlight.js so they add support to Kibana Dev Tools syntax [https://github.com/highlightjs/highlight.js/pull/1924](https://github.com/highlightjs/highlight.js/pull/1924)

I am not sure when/if they will merge that. Do you think we could look into adding that change into the version used by you?

---

<div class="post-metadata">

**Author:** ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)\
**Post date:** [December 15, 2018, 8:15pm UTC](https://discuss.elastic.co/t/about-markdown-syntax-highlighter/159628/4 "2018-12-15T20:15:29Z")

</div>

bump @system

---

<div class="post-metadata">

**Author:** ![Sam\_Saffron](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sam_saffron/32/44937_2.png) [@Sam\_Saffron](https://discuss.elastic.co/u/Sam_Saffron)\
**Post date:** [December 15, 2018, 10:06pm UTC](https://discuss.elastic.co/t/about-markdown-syntax-highlighter/159628/5 "2018-12-15T22:06:27Z")

</div>

I don't think this will be merged ☹ but I think we can achieve this with a theme component here cause its simply a client side change. It is a bit tricky cause we defer load highlight so we would have to teach the client that ... when it defer loads highlight it injects this.

So you mind doing a post asking about how to add custom highlighter on [https://meta.discoruse.org](https://meta.discoruse.org) I will assign this out to a member of our team?

---

<div class="post-metadata">

**Author:** ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)\
**Post date:** [December 15, 2018, 11:03pm UTC](https://discuss.elastic.co/t/about-markdown-syntax-highlighter/159628/6 "2018-12-15T23:03:51Z")

</div>

Thanks for replying! I will ask how to add a custom highlighter, but I thought that, since you use highlight.js, then it's basically adding another language syntax support to highlight.js, which is what I did in that PR.

---

<div class="post-metadata">

**Author:** ![Sam\_Saffron](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sam_saffron/32/44937_2.png) [@Sam\_Saffron](https://discuss.elastic.co/u/Sam_Saffron)\
**Post date:** [December 16, 2018, 12:15am UTC](https://discuss.elastic.co/t/about-markdown-syntax-highlighter/159628/7 "2018-12-16T00:15:22Z")

</div>

I follow, if it is merged it will be no problem at all we will update highlight.js and be done. Its just that looking at it I am not sure it will be merged, so I think you will need a discourse specific customisation.

---

<div class="post-metadata">

**Author:** ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)\
**Post date:** [December 16, 2018, 12:18am UTC](https://discuss.elastic.co/t/about-markdown-syntax-highlighter/159628/8 "2018-12-16T00:18:41Z")

</div>

What if a patch is generated from the changes? Is it something that can be applied to the version used here?

---

<div class="post-metadata">

**Author:** ![Sam\_Saffron](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sam_saffron/32/44937_2.png) [@Sam\_Saffron](https://discuss.elastic.co/u/Sam_Saffron)\
**Post date:** [December 18, 2018, 5:29am UTC](https://discuss.elastic.co/t/about-markdown-syntax-highlighter/159628/9 "2018-12-18T05:29:02Z")

</div>

It is not that easy, loading the patch is tricky, we can get this applied, I will track this official request and get back to you

---

<div class="post-metadata">

**Author:** ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)\
**Post date:** [January 3, 2019, 5:37pm UTC](https://discuss.elastic.co/t/about-markdown-syntax-highlighter/159628/11 "2019-01-03T17:37:02Z")

</div>

This is SO GREAT! Thank you very much!

Yes! I will let you know when/if gets merged. I've been trying to ping the authors with no luck. Will keep trying.

---

<div class="post-metadata">

**Author:** ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)\
**Post date:** [January 31, 2019, 5:37pm UTC](https://discuss.elastic.co/t/about-markdown-syntax-highlighter/159628/12 "2019-01-31T17:37:04Z")

</div>

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