# Whitelist \<mark\> tags

**URL:** <https://meta.discourse.org/t/whitelist-mark-tags/179256>\
**Category:** Feature\
**Created:** [February 10, 2021, 8:40pm UTC](https://meta.discourse.org/t/whitelist-mark-tags/179256 "2021-02-10T20:40:47Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![kemitchell](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kemitchell/32/119466_2.png) [@kemitchell](https://meta.discourse.org/u/kemitchell)\
**Post date:** [February 10, 2021, 8:40pm UTC](https://meta.discourse.org/t/whitelist-mark-tags/179256/1 "2021-02-10T20:40:47Z")

</div>

I’d like to be able to use `<mark>` tags in posts to highlight bits of text, especially in quoted language.

Is this something I should potentially take to markdown-it directly?

---

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [February 10, 2021, 9:20pm UTC](https://meta.discourse.org/t/whitelist-mark-tags/179256/2 "2021-02-10T21:20:20Z")

</div>

I think that Discourse could allow the `<mark>` HTML tag to be used in posts through a fairly small change to the core Discourse code. Getting markdown to support `mark` would be great too. I see a discussion on their forum about it here: [A proposal to support the \<mark\> tag with Markdown - Extensions - CommonMark Discussion](https://talk.commonmark.org/t/a-proposal-to-support-the-mark-tag-with-markdown/1981).

---

<div class="post-metadata">

**Author:** ![kemitchell](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kemitchell/32/119466_2.png) [@kemitchell](https://meta.discourse.org/u/kemitchell)\
**Post date:** [February 10, 2021, 9:41pm UTC](https://meta.discourse.org/t/whitelist-mark-tags/179256/3 "2021-02-10T21:41:56Z")

</div>

I went digging around the repo with `git grep markdown-it`, but got too many results to pinpoint where to propose a patch.

---

<div class="post-metadata">

**Author:** ![kemitchell](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kemitchell/32/119466_2.png) [@kemitchell](https://meta.discourse.org/u/kemitchell)\
**Post date:** [February 11, 2021, 9:07pm UTC](https://meta.discourse.org/t/whitelist-mark-tags/179256/4 "2021-02-11T21:07:31Z")

</div>

I recall that Discourse already passes through `<ins>` and `<del>`.

Those strike me as ~~vewy~~ very close to `<mark>`.

---

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [February 11, 2021, 10:35pm UTC](https://meta.discourse.org/t/whitelist-mark-tags/179256/5 "2021-02-11T22:35:42Z")

</div>

Are you just wanting to be able to use the `<mark>` HTML tag? If so, I think it just needs to get added to a list of allowed tags in the Discourse code. Someone from the dev team should know which file needs to get updated.

---

<div class="post-metadata">

**Author:** ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)\
**Post date:** [February 11, 2021, 11:00pm UTC](https://meta.discourse.org/t/whitelist-mark-tags/179256/6 "2021-02-11T23:00:07Z")

</div>

Yup, it’s `app/assets/javascripts/pretty-text/addon/allow-lister.js`. We should probably also make sure to ship some reasonable default CSS.

---

<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:** [February 13, 2021, 4:51am UTC](https://meta.discourse.org/t/whitelist-mark-tags/179256/7 "2021-02-13T04:51:35Z")

</div>

Can you share a screenshot of what `<mark>` would look like? We know what `<ins>` and `<del>` look like.. ins and ~~del~~.

Just trying to understand the goal.

---

<div class="post-metadata">

**Author:** ![kemitchell](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kemitchell/32/119466_2.png) [@kemitchell](https://meta.discourse.org/u/kemitchell)\
**Post date:** [February 13, 2021, 5:33am UTC](https://meta.discourse.org/t/whitelist-mark-tags/179256/8 "2021-02-13T05:33:35Z")

</div>

```css
background-color: yellow;

```

IIRC this is more or less as stands in many user-agent default styles.

---

<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:** [February 13, 2021, 10:42pm UTC](https://meta.discourse.org/t/whitelist-mark-tags/179256/9 "2021-02-13T22:42:23Z")

</div>

I suppose that seems benign enough, and we have precedent in the form of `<ins>` and `<del>`.. what do you think @sam @eviltrout?

---

<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:** [February 14, 2021, 7:15am UTC](https://meta.discourse.org/t/whitelist-mark-tags/179256/10 "2021-02-14T07:15:18Z")

</div>

Seems easy and fine @techAPJ can sort it next week

---

<div class="post-metadata">

**Author:** ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)\
**Post date:** [February 15, 2021, 4:53pm UTC](https://meta.discourse.org/t/whitelist-mark-tags/179256/12 "2021-02-15T16:53:31Z")

</div>

Done via:

[https://github.com/discourse/discourse/commit/85c4e8fd32fdf61a2987c2b181661bbd7d203913](https://github.com/discourse/discourse/commit/85c4e8fd32fdf61a2987c2b181661bbd7d203913)

> `This text is <mark>highlighted</mark>.`

This text is highlighted.

---

<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:** [February 22, 2021, 4:00pm UTC](https://meta.discourse.org/t/whitelist-mark-tags/179256/13 "2021-02-22T16:00:44Z")

</div>

This topic was automatically closed after 6 days. New replies are no longer allowed.
