Copying text of elements that are visually adjacent
Nobody has claimed this yet.
- Dominant language
- Bikeshed
- Stars
- 4.9k
- Forks
- 816
- PR merge metrics
- PR metrics pending
Description
Take some markup like:
<unknown>
<unknown>one two</unknown>
<unknown>three four</unknown>
</unknown>
These elements can appear adjacent via a number of layout systems, such as inline-block, table, floats, flex, grid.
Depending on container width, they could appear visually in a variety of ways:
one twothree four
---
onethree
twofour
---
one twothree
four
What should be in the clipboard when the user copies this text? Does it depend on the layout system used? Does it depend on the elements used? Does it depend on container width?
In this example where I try to emulate VSCode's wrapping style, I'd like visually adjacent elements to be copied as if they're adjacent.
However, I can see cases, such as a row of two paragraphs, where I'd want them to be copied in the same way as two block elements.
Should this be author controllable?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the markup and the linked JS Bin example, then compare expected clipboard text for inline-block, table, float, flex, and grid layouts across the shown wrapping cases. Done means a clear resolution for whether copying follows visual adjacency, element type, layout system, or author-controlled behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, html
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100