# The "button" HTML5 tag renders in the editor previewer, but not rendered posts

**URL:** https://meta.discourse.org/t/the-button-html5-tag-renders-in-the-editor-previewer-but-not-rendered-posts/358811
**Category:** Bug
**Created:** [March 25, 2025, 6:39pm UTC](https://meta.discourse.org/t/the-button-html5-tag-renders-in-the-editor-previewer-but-not-rendered-posts/358811 "2025-03-25T18:39:39Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [March 25, 2025, 9:21pm UTC](https://meta.discourse.org/t/the-button-html5-tag-renders-in-the-editor-previewer-but-not-rendered-posts/358811/2 "2025-03-25T21:21:27Z")

</div>

I’m not sure if it’s a bug per se. I understand your confusion.

To prevent HTML tags and attributes/classnames from being filtered out, this needs to be explicitly allowed in Discourse core or a plugin.

For example, a default list can be found here:  
[https://github.com/discourse/discourse/blob/main/app/assets/javascripts/pretty-text/addon/allow-lister.js#L115](https://github.com/discourse/discourse/blob/main/app/assets/javascripts/pretty-text/addon/allow-lister.js#L115)

It’s also possible to allow a tag for the preview only. For example, the image controls have several tag/class name/attribute combinations.

[https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse-markdown-it/src/features/image-controls.js#L198](https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse-markdown-it/src/features/image-controls.js#L198)

You see the button in preview because it’s a side effect of the tag that is allowed here.  
However, the `disabled` attribute is ignored because it is not defined.

[https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse-markdown-it/src/features/image-controls.js#L223](https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse-markdown-it/src/features/image-controls.js#L223)

I did not check how the allowed list is parsed; I wonder if it’s the expected behavior. 🤔. Currently, it seems the tag is allowed regardless of the attributes. I would have expected that the button is not rendered if you are not using exactly, for example, `<button class="alt-text-edit-ok btn btn-primary">`.

You can make a plugin to allow `<button>` on post render. Let me know if you need assistance.

---

_[View the full topic](https://meta.discourse.org/t/the-button-html5-tag-renders-in-the-editor-previewer-but-not-rendered-posts/358811)._
