# Html element whitelisting in plugin not taking effect server side

**URL:** <https://meta.discourse.org/t/html-element-whitelisting-in-plugin-not-taking-effect-server-side/66175>\
**Category:** Product Support\
**Created:** [July 14, 2017, 4:39am UTC](https://meta.discourse.org/t/html-element-whitelisting-in-plugin-not-taking-effect-server-side/66175 "2017-07-14T04:39:43Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Benjamin\_Mosior](https://avatars.discourse-cdn.com/v4/letter/b/59ef9b/32.png) [@Benjamin\_Mosior](https://meta.discourse.org/u/Benjamin_Mosior)\
**Post date:** [July 14, 2017, 4:39am UTC](https://meta.discourse.org/t/html-element-whitelisting-in-plugin-not-taking-effect-server-side/66175/1 "2017-07-14T04:39:44Z")

</div>

I’m working with a group that focuses heavily on personal knowledge management (they use Evernote and similar software). Highlighting is important to them, so I’d like to support the [`<mark>`](https://www.w3schools.com/tags/tag_mark.asp) html tag in posts through a plugin. I would like to avoid bbcode or using `<ins>` if possible. (As an aside, official support for `<mark>` could be neat.)

Based on what I could find in these forums and reading through the source code, I landed on the following directive to whitelist the tag in `assets/javascripts/lib/discourse-markdown/my-plugin.js.es6`:

```plaintext
// snip

export function setup(helper) {
  helper.whiteList(['mark']);
}

```

The above works client-side but fails server-side (the tags are stripped out).

 ![](https://global.discourse-cdn.com/meta/original/3X/d/e/de5d47bd65580f6f5f3a567877cd012d07cee65d.png)

(As an aside, you can see I’m also adding a button for it as well. Love how easy that was to do!)

I’m taking an educated guess (based on other forum posts) that this is related to the `html_to_markdown` function. This test fails despite the whitelist above:

```plaintext
require 'rails_helper'
require 'html_to_markdown'

describe HtmlToMarkdown do

  def html_to_markdown(html, opts={})
    HtmlToMarkdown.new(html, opts).to_markdown
  end

  it "supports <mark>" do
    expect(html_to_markdown("<mark>Highlighted</mark>")).to eq("<mark>Highlighted</mark>")
  end

end

```

```plaintext
Failures:

  1) HtmlToMarkdown supports <mark>
     Failure/Error: expect(html_to_markdown("<mark>Highlighted</mark>")).to eq("<mark>Highlighted</mark>")

       expected: "<mark>Highlighted</mark>"
            got: "Highlighted"

       (compared using ==)

```

Is this a reasonable pursuit? What am I missing to provide support for this server-side?

---

_[View the full topic](https://meta.discourse.org/t/html-element-whitelisting-in-plugin-not-taking-effect-server-side/66175)._
