Skip to content

[css-text-4] text-autospace: what gets copied? #8511

Description

@fantasai

@r12a wrote in #4246 (comment) :

Suppose a piece of Japanese text and a piece of French text contains some sentences where ascii spaces are used to create spacing and other sentences where no such space characters are used. Then a content author applied auto-space, let's say for arguments sake with replace switched on. Then a reader copies the text containing gaps. What ends up on the clipboard?

I'm assuming that the clipboard would contain space characters where they were originally present in the text, but not retain any gaps where the separation was achieved only through applying CSS autospace.

(In other words, if you copy several paragraphs in French where the original author used autospace to introduce a gap before/after punctuation, then after pasting the text would need to be autospaced or manually edited to reintroduce the gaps.)

We have two types of autospacing:

  • inserts gaps that don't correspond to any particular character (inter-script values)
  • inserts special spaces (punctuation value)

Also, in both cases, the replace keyword can remove U+0020 from the text.

In general, CSS doesn't alter the text that gets copied (e.g. text-transform is not applied), but we do make at least one exception:

There's also a bit of an open question on whether the content property should affect copy/paste. It thought we'd discussed this, but can't find it...

It's pretty clear to me that the first type of autospacing doesn't insert anything into the copied text. However, for the removal of U+0020 or insertion of nbsp and narrow no-break space, etc, are these copied into the paste buffer?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions