# Has something changed with pasting html into the composer?

**URL:** https://meta.discourse.org/t/has-something-changed-with-pasting-html-into-the-composer/407661
**Category:** Support
**Tags:** composer
**Created:** [July 15, 2026, 4:47am UTC](https://meta.discourse.org/t/has-something-changed-with-pasting-html-into-the-composer/407661 "2026-07-15T04:47:50Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![one1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/one1/32/493591_2.png) [@one1](https://meta.discourse.org/u/one1)
#### Post date: [July 15, 2026, 4:47am UTC](https://meta.discourse.org/t/has-something-changed-with-pasting-html-into-the-composer/407661/1 "2026-07-15T04:47:51Z")

</div>

Recently I noticed that when I paste (some) text into the composer span tags are included. For example

```plaintext
<span lang="en">Then the brahmin Jānussoṇi went up to the Buddha, and exchanged greetings with him.</span><span lang="en">When the greetings and polite conversation were over, he sat down to one side and said to the Buddha:</span>

```

I can only reproduce this when the spans include the `lang` parameter.

And strangely, if I type three back ticks in the composer to start a code block and paste the text on the next line, the span tags are _ **not** _ pasted. So

```plaintext
Then the brahmin Jānussoṇi went up to the Buddha, and exchanged greetings with him. When the greetings and polite conversation were over, he sat down to one side and said to the Buddha:

```

That’s really, really strange.

Was there some change to the way html gets processed? I know (and appreciate) that some limited html gets converted into Markdown. However those spans should not be pasted.

(If anything, pasting into a code block should include the spans and pasting into a regular paragraph should not. But honestly I don’t think they should be pasted anywhere)

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [July 15, 2026, 8:51am UTC](https://meta.discourse.org/t/has-something-changed-with-pasting-html-into-the-composer/407661/2 "2026-07-15T08:51:04Z")

</div>

Where did you copy the text from?

@renato has been doing some fixes in this area recently, not sure if there’s been any regressions though.

---

<div class="post-metadata">

### Author: ![one1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/one1/32/493591_2.png) [@one1](https://meta.discourse.org/u/one1)
#### Post date: [July 15, 2026, 9:16am UTC](https://meta.discourse.org/t/has-something-changed-with-pasting-html-into-the-composer/407661/3 "2026-07-15T09:16:47Z")

</div>

[Here is an example page](https://suttacentral.net/mn4/en/sujato).

I have tried pasting similar text that has spans without the `lang` params and they paste as normal, i.e. no html span tags. That’s why I’m thinking it has to do with the `lang`

I should also note we are on v2026.7.0-latest.

---

<div class="post-metadata">

### Author: ![renato](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/renato/32/383632_2.png) [@renato](https://meta.discourse.org/u/renato)
#### Post date: [July 15, 2026, 10:46am UTC](https://meta.discourse.org/t/has-something-changed-with-pasting-html-into-the-composer/407661/4 "2026-07-15T10:46:13Z")

</div>

I merged an improvement yesterday to avoid these span HTML elements when they come from Word, but I’ll take another look with your example. Please let us know if you find any other example.

Just note than a span element with the lang attribute is a valid combination as an inline html markdown-it token, the system is keeping them for consistency because it’s “valid”, my concern is “fixing it too much” and stripping instances with additional attributes that were intentional (maybe not even an issue, I’ll investigate).

> [@one1](#):
>
> (If anything, pasting into a code block should include the spans and pasting into a regular paragraph should not. But honestly I don’t think they should be pasted anywhere)

This is not the case because the clipboard contains both HTML and text/plain in this scenario, and the system uses the appropriate origin if you paste outside vs inside a code block.

---

<div class="post-metadata">

### Author: ![one1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/one1/32/493591_2.png) [@one1](https://meta.discourse.org/u/one1)
#### Post date: [July 15, 2026, 11:23am UTC](https://meta.discourse.org/t/has-something-changed-with-pasting-html-into-the-composer/407661/6 "2026-07-15T11:23:35Z")

</div>

Someone suggested I share a screenshot of what I mean:

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

In the rendered (?) version it looks fine except for the fact that the space is missing between the spans.

EDIT: But we don’t want them in the composer at all. They make things really messy and hard to read.

---

<div class="post-metadata">

### Author: ![one1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/one1/32/493591_2.png) [@one1](https://meta.discourse.org/u/one1)
#### Post date: [July 30, 2026, 6:05am UTC](https://meta.discourse.org/t/has-something-changed-with-pasting-html-into-the-composer/407661/7 "2026-07-30T06:05:04Z")

</div>

> [@renato](#):
>
> my concern is “fixing it too much” and stripping instances with additional attributes that were intentional

I’m curious where you are at with this. I’m 100% sure this started happening recently on our forum. We haven’t done an upgrade in about three weeks. Are you planning on not keeping the spans with the `lang` params? Or do we need to find a way to fix this on our own.

I’d really just like for it to go back to the way it was prior to about a month ago. We’ve been pasting from our website to our forum for 10 years and this only started happening very recently.

---

<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: [July 31, 2026, 8:13pm UTC](https://meta.discourse.org/t/has-something-changed-with-pasting-html-into-the-composer/407661/8 "2026-07-31T20:13:45Z")

</div>

It does seem like the missing whitespace is a real issue that should be fixed; once that’s taken care of the extra lang tags only look weird in the editor without actually hurting the final post.

---

<div class="post-metadata">

### Author: ![one1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/one1/32/493591_2.png) [@one1](https://meta.discourse.org/u/one1)
#### Post date: [August 1, 2026, 12:24am UTC](https://meta.discourse.org/t/has-something-changed-with-pasting-html-into-the-composer/407661/9 "2026-08-01T00:24:35Z")

</div>

> [@riking](#):
>
> the extra lang tags only look weird in the editor without actually hurting the final post

While technically true, for our users (who are almost all non-coders) having all of those spans pasted in is indeed problematic. Because our source material puts these spans around every phrase, there could be a dozen span sets in a single paragraph of text.

We just are asking for this to be treated the same way it was prior to the recent change (i.e. not paste html simply because there are `lang` params in the elements)

---

<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: [August 1, 2026, 12:30am UTC](https://meta.discourse.org/t/has-something-changed-with-pasting-html-into-the-composer/407661/10 "2026-08-01T00:30:16Z")

</div>

I think Renato is working on a fix

> <https://github.com/discourse/discourse/pull/42163>
>
> Text copied from a web page arrived in the composer wrapped in literal \`\<span la…ng="en"\>\` markup, and with the spaces between sentences missing.
> 
> Publishing tools stamp \`lang\` on the spans they wrap each sentence in, and the DOM parse rule accepted it. The whitespace went with it: a space sitting at the edge of a span is normalised away when the span survives as a node, so the sentences ran together in the post, not only in the composer.
> 
> Spans are no longer parsed from DOM, so both go away. A \`lang\` written in markdown arrives as a token instead, so it still round-trips, including while the span is edited. This also covers the Word-specific strip that handled the same problem for a single source.
> 
> An authored \`lang\` now survives only as markdown, and is dropped whenever a span reaches the composer as HTML, including quoting a post.
> 
> Reported in \[Has something changed with pasting HTML into the composer?\](https://meta.discourse.org/t/has-something-changed-with-pasting-html-into-the-composer/407661)

---

<div class="post-metadata">

### Author: ![renato](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/renato/32/383632_2.png) [@renato](https://meta.discourse.org/u/renato)
#### Post date: [August 6, 2026, 6:04pm UTC](https://meta.discourse.org/t/has-something-changed-with-pasting-html-into-the-composer/407661/11 "2026-08-06T18:04:53Z")

</div>

[This](https://github.com/discourse/discourse/pull/42163) has been merged. Let us know if there’s anything still missing.

Thank you!

---

<div class="post-metadata">

### Author: ![one1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/one1/32/493591_2.png) [@one1](https://meta.discourse.org/u/one1)
#### Post date: [August 11, 2026, 12:05pm UTC](https://meta.discourse.org/t/has-something-changed-with-pasting-html-into-the-composer/407661/12 "2026-08-11T12:05:04Z")

</div>

Recently upgrade and the fix worked.

Thank you!!!
