Open hsivonen opened 2 years ago
At least sanitizing text in clipboard.readText()
was identified as an issue, see "Issue 5" in step 1.3 of https://w3c.github.io/clipboard-apis/#dom-clipboard-readtext, so that's in scope of this spec.
The Web Editing Working Group just discussed Henri's issue
.
For the record: Chrome (at least on Ubuntu 20.04) forbids copying when a contenteditable
element is selected: data:text/html,A<div contenteditable>X</div>
.
CC @masayuki-nakano
The shortest path to have all three do the same thing would be for Gecko to change only not to replace no-break spaces when exporting plain text as plain text.
This was OK.
Would it be bad in practice (as opposed to principle of deviating from the current interop state) to replace no-break space with regular spaces in HTML to plain text conversion only when the contentEditable-like pattern of alternating spaces and no-break spaces is detected?
This turned out not to be Web-compatible due there being sites that, instead of using the pre
element or a relevant CSS property, replaced spaces in code examples with no-break spaces and relied on browser reversing the replacement upon copy to clipboard.
Gecko bug for context.
It's unclear to me if the operation of generating a plain-text representation of HTML copied to the clipboard is within the scope of this (or any) spec, but in case it is:
It appears that:
The shortest path to have all three do the same thing would be for Gecko to change only not to replace no-break spaces when exporting plain text as plain text.
However, it's bad to replace no-break spaces with regular spaces in HTML to plain text conversion in cases where the no-break spaces are used for a legitimate purpose (e.g. in combination with French quotation marks). At least in Gecko, the replacement of no-break spaces with regular spaces is motivated by undoing the
contentEditable
behavior of generating making every other space bar press insert a no-break space to counteract CSS's space collapsing behavior and producing visible spaces on every space bar press incontentEditable
.Questions:
contentEditable
-like pattern of alternating spaces and no-break spaces is detected?