# 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:** 2

<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 14, 2017, 10:24am UTC](https://meta.discourse.org/t/html-element-whitelisting-in-plugin-not-taking-effect-server-side/66175/2 "2017-07-14T10:24:47Z")

</div>

Do you use reply by email often, as I thought HtmlToMarkdown was only utilized by incoming emails. Here is my spec (which @sam graciously wrote when upgrading to the new markdown engine)

```ruby
require 'rails_helper'

describe PrettyText do

  context 'markdown it' do
    before do
      SiteSetting.enable_experimental_markdown_it = true
    end

    it 'can properly bake boxes' do
      md = <<~MD
        [],[],[_];[-]X[x]X [*] [\\*] are all checkboxes
        `[]` [x](hello) *[]* **[]** are not checkboxes
      MD

      html = <<~HTML
        <p><span class="chcklst-box fa fa-square-o"></span>,<span class="chcklst-box fa fa-square-o"></span>,<span class="chcklst-box fa fa-square"></span>;<span class="chcklst-box fa fa-minus-square-o"></span>X<span class="chcklst-box checked fa fa-check-square"></span>X <span class="chcklst-box checked fa fa-check-square-o"></span> <span class="chcklst-box checked fa fa-check-square-o"></span> are all checkboxes<br>
        <code>[]</code> <a>x</a> <em>[]</em> <strong>[]</strong> are not checkboxes</p>
      HTML
      cooked = PrettyText.cook(md)
      expect(cooked).to eq(html.strip)
    end
  end
end

```

And my whitelist that seems to work both server-side and client-side

```plaintext
export function setup(helper) {
  helper.whiteList([ 'span.chcklst-stroked',
                     'span.chcklst-box fa fa-square-o',
                     'span.chcklst-box fa fa-square',
                     'span.chcklst-box fa fa-minus-square-o',
                     'span.chcklst-box checked fa fa-check-square',
                     'span.chcklst-box checked fa fa-check-square-o' ]);
}

```

---

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