Recently I noticed that when I paste (some) text into the composer span tags are included. For example
<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
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)
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 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).
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.