1

I've noticed that some user-generated rich content on a site that I maintain has become littered with invisible span tags carrying data attributes:

<span data-preserver-spaces="true">Lorem ipsum dolor sit amet </span><em><span
data-preserver-spaces="true">consequatur</span></em><span data-preserver-spaces="true">
explicabo soluta. Eos quam temporibus rerum ullam perferendis, architecto velit nulla.</span>

I assume this was injected by a browser extension or something on the user's machine, or perhaps was pasted from other software. Can anyone identify the source?

A web search just turned up more examples of the same phenomenon on other websites using a variety of CMSs.

8
  • I don't know of any rich content editing support that's natively built into web browsers. I'd imagine that all the CMSs that you were seeing this in use some common rich editing JavaScript and CSS library that is causing the problem. Aug 11, 2020 at 8:40
  • @StephenOstermiller contenteditable
    – ændrük
    Aug 11, 2020 at 15:51
  • contenteditable is usually accompanied by a load of JavaScript to control the formatting of elements within it though. On its own, it is pretty much just text. Aug 11, 2020 at 18:26
  • @StephenOstermiller I'm not sure what you're getting at. I think you're trying to refute my assumption but I'm not sure how the points you've made relate to it.
    – ændrük
    Aug 12, 2020 at 16:16
  • 1
    1) I'm familiar with my site and don't know it to have this behavior, 2) only a small amount of the content on my site is affected, and 3) other websites affected in the wild appear to span a diverse range of tech stacks.
    – ændrük
    Aug 13, 2020 at 0:26

1 Answer 1

2

If text is copied and pasted from Grammarly editor HTML like this can be inserted.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.