When copying the text from ``` <div style="display: inline-flex; white-space: pre"> <span>This </span> <span>is </span> <span>flex </span> </div> ``` The data that would be pasted would contain multiple lines: ``` This is flex ``` And yet that is not similar to how it is presented in the browser: ``` This is flex ```
<rdar://problem/40758006>
I would like to add, this isn't just specific to inline-flex. It's possible that other flex box layouts do strange things when copying/pasting to plain text. Basically, copying/pasting from flex boxes generates unexpected output.
We don't have any code to handle flex box for copy & paste so anything is possible. We probably need to do some work to support both flex box & grid layouts in our copy & paste logic somehow.
I did work around the issue by using an `oncopy` event handler: https://github.com/ioquatix/jquery-syntax/blob/3cf6353facbc807c94b53cdf48c372547b7ac089/source/jquery.syntax.core.js#L45-L66
I am just reporting that this is still an issue. You can see a live example here: https://www.codeotaku.com/journal/2018-06/improving-ruby-fibers/index Try copying only the code, it will invoke the copy handler which copies it as plain text. If you try to copy it including some of the preceding paragraph, it won't invoke the copy handler. If you paste the result into, say, TextEdit, you will get odd output.
Yes, this is an issue. We need to handle flexbox in our copy & paste code. We don't currently have the support for it.