# Rich text editor erases HTML tags from post

**URL:** https://meta.discourse.org/t/rich-text-editor-erases-html-tags-from-post/393758
**Category:** Bug
**Tags:** composer
**Created:** [January 19, 2026, 1:36am UTC](https://meta.discourse.org/t/rich-text-editor-erases-html-tags-from-post/393758 "2026-01-19T01:36:54Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![seanblue](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@seanblue](https://meta.discourse.org/u/seanblue)
#### Post date: [January 19, 2026, 1:36am UTC](https://meta.discourse.org/t/rich-text-editor-erases-html-tags-from-post/393758/1 "2026-01-19T01:36:54Z")

</div>

If you use the markdown editor and include some raw HTML tags (e.g. `br` tag for table formatting), then edit the post using the rich text editor, the HTML content is lost. I don’t know if this is the case for all allowed HTML tags, but at the very least it happens for `br` tags. This may not be a big deal for regular posts since most users presumably stick with one type of editor, but for wiki posts this is a major issue. Over on WaniKani, we have a [massive wiki post](https://community.wanikani.com/t/master-list-of-book-clubs/35283) with several tables that rely on `br` tags for structure. However, if someone happens to edit the wiki in rich text mode, all `br` tags are removed, ruining the formatting of the post.

(Secondarily, there doesn’t seem to be an easy way to revert to a previous version of the wiki. If that was available, at least some of this pain would be mitigated. I can write up a feature request for that as well if the feature doesn’t already exist.)

* * *

Markdown editor:

 ![image](https://global.discourse-cdn.com/meta/original/4X/5/f/a/5fa4cc956e0b019d8c662f6d7e7dc4a8bbdc596a.png)

Rich text editor:

 ![image](https://global.discourse-cdn.com/meta/original/4X/5/0/2/5027c428c2d453df1e32cc8a2c90d3cd0b75804f.png)

---

<div class="post-metadata">

### Author: ![seanblue](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@seanblue](https://meta.discourse.org/u/seanblue)
#### Post date: [January 19, 2026, 1:38am UTC](https://meta.discourse.org/t/rich-text-editor-erases-html-tags-from-post/393758/2 "2026-01-19T01:38:50Z")

</div>

Use this post to see what I mean. I don’t think I can make this post a wiki myself, but admins/mods should be able to try it. (If not, it’s easy to reproduce.)

| Column 1 | Column 2 |
| --- | --- |
| Text 1a  
Text1b | Text 3a  
Text3b |
| Text 2a  
Text2b | Text 4a  
Text4b |

---

<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: [January 19, 2026, 2:25am UTC](https://meta.discourse.org/t/rich-text-editor-erases-html-tags-from-post/393758/3 "2026-01-19T02:25:42Z")

</div>

Confirmed this is a bug in our table editor, the content in cells is considered inline, but really we would need to treat it as a type of block to keep the `<br>` mapping going.

@renato any thoughts here, it is an edge case, but I agree it would be nice to support it.

---

<div class="post-metadata">

### Author: ![seanblue](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@seanblue](https://meta.discourse.org/u/seanblue)
#### Post date: [January 19, 2026, 3:12am UTC](https://meta.discourse.org/t/rich-text-editor-erases-html-tags-from-post/393758/4 "2026-01-19T03:12:18Z")

</div>

> [@sam](#):
>
> Confirmed this is a bug in our table editor

Just to confirm, by table editor do you mean specifically the table editor popup or some edit logic for tables in the general post editor? Because I’m referring to the post editor itself.

---

<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: [January 19, 2026, 4:06am UTC](https://meta.discourse.org/t/rich-text-editor-erases-html-tags-from-post/393758/5 "2026-01-19T04:06:33Z")

</div>

post editor … rich text editor does not support this at the moment, there is no workaround for it.

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [January 20, 2026, 1:59am UTC](https://meta.discourse.org/t/rich-text-editor-erases-html-tags-from-post/393758/6 "2026-01-20T01:59:41Z")

</div>

Would it be viable to at least _detect_ these situations and disable the RTE?

---

<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: [January 20, 2026, 11:32am UTC](https://meta.discourse.org/t/rich-text-editor-erases-html-tags-from-post/393758/8 "2026-01-20T11:32:55Z")

</div>

I much prefer to fix it, I really dislike the hack of disabling the composer, totally get how it happened that we introduced it in the past, but I do not think we need to reach to it here

---

<div class="post-metadata">

### Author: ![seanblue](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@seanblue](https://meta.discourse.org/u/seanblue)
#### Post date: [January 20, 2026, 1:04pm UTC](https://meta.discourse.org/t/rich-text-editor-erases-html-tags-from-post/393758/9 "2026-01-20T13:04:29Z")

</div>

I have another example that is not inside of tables. You can use a `span` tag with a `lang` attribute to differentiate Japanese and Chinese fonts. This also seems to be lost when switching from markdown to rich text editor. Interestingly, the `big` tag is retained.

続

続

---

<div class="post-metadata">

### Author: ![seanblue](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@seanblue](https://meta.discourse.org/u/seanblue)
#### Post date: [February 9, 2026, 1:28pm UTC](https://meta.discourse.org/t/rich-text-editor-erases-html-tags-from-post/393758/10 "2026-02-09T13:28:58Z")

</div>

Any update on this issue?

---

<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 10, 2026, 5:49am UTC](https://meta.discourse.org/t/rich-text-editor-erases-html-tags-from-post/393758/11 "2026-02-10T05:49:35Z")

</div>

I have a fix here:

[https://github.com/discourse/discourse/pull/37656](https://github.com/discourse/discourse/pull/37656)

Also does ruby and span with lang

Entering Ruby in the rich editor is still going to be tricky, once it is there it is fine, but getting it there is not easy. That said the features are now more complete post this change.

@renato can you have a look?

---

<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 11, 2026, 12:25am UTC](https://meta.discourse.org/t/rich-text-editor-erases-html-tags-from-post/393758/12 "2026-02-11T00:25:06Z")

</div>

Fix is merged 🎊 enjoy

---

<div class="post-metadata">

### Author: ![seanblue](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@seanblue](https://meta.discourse.org/u/seanblue)
#### Post date: [February 11, 2026, 2:17am UTC](https://meta.discourse.org/t/rich-text-editor-erases-html-tags-from-post/393758/14 "2026-02-11T02:17:20Z")

</div>

Thank you for the quick turnaround!

Roughly when should I expect it to show up on [https://community.wanikani.com](https://community.wanikani.com)? I want to let everyone know when it’ll be safe to edit the tables with the rich text editor. According to the source, it’s currently on 2026.1.0-latest, commit `f8f53ac5e8e4348ae308fcddc078766463d5e5f3` which is three weeks old.

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [February 11, 2026, 8:41am UTC](https://meta.discourse.org/t/rich-text-editor-erases-html-tags-from-post/393758/15 "2026-02-11T08:41:11Z")

</div>

Right after upgrading?

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [February 11, 2026, 8:44am UTC](https://meta.discourse.org/t/rich-text-editor-erases-html-tags-from-post/393758/16 "2026-02-11T08:44:08Z")

</div>

As a customer of Discourse hosting, you cannot update it yourself, so I think asking them when that is going to happen is legitimate.

---

<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 11, 2026, 9:00pm UTC](https://meta.discourse.org/t/rich-text-editor-erases-html-tags-from-post/393758/17 "2026-02-11T21:00:46Z")

</div>

This topic was automatically closed after 20 hours. New replies are no longer allowed.

---

<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 16, 2026, 2:03am UTC](https://meta.discourse.org/t/rich-text-editor-erases-html-tags-from-post/393758/18 "2026-02-16T02:03:35Z")

</div>

Shoot of an email to [team@discourse.org](mailto:team@discourse.org) 🤗
