# Discourse CommonMark text highlighting?

**URL:** https://meta.discourse.org/t/discourse-commonmark-text-highlighting/92936
**Category:** Feature
**Created:** [July 23, 2018, 3:21pm UTC](https://meta.discourse.org/t/discourse-commonmark-text-highlighting/92936 "2018-07-23T15:21:21Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Lew\_Grothe](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lew_grothe/32/337776_2.png) [@Lew\_Grothe](https://meta.discourse.org/u/Lew_Grothe)
#### Post date: [July 23, 2018, 3:21pm UTC](https://meta.discourse.org/t/discourse-commonmark-text-highlighting/92936/1 "2018-07-23T15:21:21Z")

</div>

Probably not really a bug but, I know that “standard” Markdown discussions are somewhat fraught and this question seems to not be dealt with in the latest [ComonMark spec](https://spec.commonmark.org/0.28/) but…

It appears that, in accordance with at least one (the Ghost project) guide of the [CommonMark spec](https://help.ghost.org/article/4-markdown-guide):

```plaintext
~~strikethrough~~

```

should give you a ~~strikethrough~~ (and it does) but

```plaintext
==highlight==

```

should give you a ==highlight== text - and it doesn’t.

Attempting to use \<span style=“background-color:yellow;”\> tags or other means seems to also not work for me…

So, based on the CommonMark used by Discourse, is there a way to do text highlighting? Is there a better guide for us to use to get answers to questions like this?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [July 23, 2018, 3:30pm UTC](https://meta.discourse.org/t/discourse-commonmark-text-highlighting/92936/2 "2018-07-23T15:30:09Z")

</div>

> Ghost’s version of markdown is fully [CommonMark compliant](http://commonmark.org/) with **a few other useful features like footnotes**.

Highlight being of the “few other”.

```plaintext
<mark>Highlight</mark> being of the "few other".

```

You can try and package [GitHub - markdown-it/markdown-it-mark: \<mark\> tag plugin for markdown-it markdown parser · GitHub](https://github.com/markdown-it/markdown-it-mark) as a plugin using [Developer's guide to Markdown extensions](https://meta.discourse.org/t/developers-guide-to-markdown-extensions/66023).

---

<div class="post-metadata">

### Author: ![Lew\_Grothe](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lew_grothe/32/337776_2.png) [@Lew\_Grothe](https://meta.discourse.org/u/Lew_Grothe)
#### Post date: [July 23, 2018, 3:59pm UTC](https://meta.discourse.org/t/discourse-commonmark-text-highlighting/92936/3 "2018-07-23T15:59:32Z")

</div>

Interesting (but, beyond what I can do in the 2 weeks I have to put into this at this time)…

Playing on the [Markdown-it demo page](https://markdown-it.github.io/#md3=%7B%22source%22%3A%22 ~~strikethrough~~ %5Cn%5Cn%3D%3Dhighlight%3D%3D%5Cn%22%2C%22defaults%22%3A%7B%22html%22%3Afalse%2C%22xhtmlOut%22%3Afalse%2C%22breaks%22%3Afalse%2C%22langPrefix%22%3A%22language-%22%2C%22linkify%22%3Atrue%2C%22typographer%22%3Atrue%2C%22_highlight%22%3Atrue%2C%22_strict%22%3Afalse%2C%22_view%22%3A%22html%22%7D%7D), exactly what I want is available. Off hand, do you know if:

1. The version of Markdown-it included in Discourse is feature hobbled in some way?
2. Markdown-it might be an older version in the Discourse release?

(I know that this is easily found out by me but you were so quick in responding before that I’m now a spoiled user dependent on you 😁)

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [July 23, 2018, 4:02pm UTC](https://meta.discourse.org/t/discourse-commonmark-text-highlighting/92936/4 "2018-07-23T16:02:27Z")

</div>

> [@Lew\_Grothe](#):
>
> - The version of Markdown-it included in Discourse is feature hobbled in some way?

We use just markdown-it.

That demo also supports footnotes which are a markdown-it plugin, that we provide at [Discourse Footnote](https://meta.discourse.org/t/discourse-footnote/84533).

---

<div class="post-metadata">

### Author: ![Lew\_Grothe](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lew_grothe/32/337776_2.png) [@Lew\_Grothe](https://meta.discourse.org/u/Lew_Grothe)
#### Post date: [July 23, 2018, 4:49pm UTC](https://meta.discourse.org/t/discourse-commonmark-text-highlighting/92936/5 "2018-07-23T16:49:23Z")

</div>

Good catch and clue…

On our test site, installed Discourse footnote plugin and footnotes work fine (settings are all turned on) but highlighting is still as before…

Thanks again for your suggestion…

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [July 23, 2018, 10:52pm UTC](https://meta.discourse.org/t/discourse-commonmark-text-highlighting/92936/6 "2018-07-23T22:52:09Z")

</div>

Someone would have to re-package the highlight markdown-it plugin into a Discourse plugin for it to become available. You could likely take a stab at it by forking the footnote plugin and finding all instance of footnote and replacing it with “mark”

---

<div class="post-metadata">

### Author: ![sirideain](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sirideain/32/101202_2.png) [@sirideain](https://meta.discourse.org/u/sirideain)
#### Post date: [July 24, 2018, 1:50am UTC](https://meta.discourse.org/t/discourse-commonmark-text-highlighting/92936/7 "2018-07-24T01:50:33Z")

</div>

This caught my interest as I thought it would useful on my installation as well. So here is a plugin for highlighting. Being as it is my first plugin, I suspect it needs a fair bit of cleanup even with having used other plugins as templates/inspiration. It did work in my test environment though.

[https://github.com/sirideain/discourse-mark](https://github.com/sirideain/discourse-mark)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [July 24, 2018, 1:52am UTC](https://meta.discourse.org/t/discourse-commonmark-text-highlighting/92936/8 "2018-07-24T01:52:56Z")

</div>

I added you to the `@plugin_authors` group so feel free to do a full post in #Customization > Plugin about it!

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [July 24, 2018, 3:12am UTC](https://meta.discourse.org/t/discourse-commonmark-text-highlighting/92936/9 "2018-07-24T03:12:36Z")

</div>

We already have insert and ~~delete~~

`We already have <ins>insert</ins> and <del>delete</del>`

---

<div class="post-metadata">

### Author: ![Andrei\_Blanda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andrei_blanda/32/184398_2.png) [@Andrei\_Blanda](https://meta.discourse.org/u/Andrei_Blanda)
#### Post date: [June 19, 2020, 10:52am UTC](https://meta.discourse.org/t/discourse-commonmark-text-highlighting/92936/10 "2020-06-19T10:52:58Z")

</div>

Would love to use this @sirideain

I’m getting this?  
"“Import Error: about.json does not exist, or is invalid. Are you sure this is a Discourse Theme”?

Thank you.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [June 19, 2020, 11:05am UTC](https://meta.discourse.org/t/discourse-commonmark-text-highlighting/92936/11 "2020-06-19T11:05:11Z")

</div>

This is a plugin, not a theme. You’ll need to check [Install plugins on a self-hosted site](https://meta.discourse.org/t/install-plugins-in-discourse/19157)
