-
Notifications
You must be signed in to change notification settings - Fork 757
Description
As described in my stack overflow post at https://stackoverflow.com/questions/76280867/enable-user-select-on-ol-li-marker-to-avoid-losing-numbers-from-numbered-lis
"""
I face a problem with copying numbered lists (<ol>) from a chat application. When I copy the text, it doesn't include ::marker numbers. This makes the list items lose context, as numbers represent the order of content.
I know CSS ::marker pseudo-element isn't selectable by default, but I seek a workaround. The chat application often generates ordered lists, and users need to copy entire text, numbers included. It's not my app so I need to override CSS using the Stylus Chrome extension, I can't change their HTML or JS.
Does anyone know a way to select ::marker content, or keep ol li list numbers during text copy?
Here's a basic example:
<ol>
<li>Item one</li>
<li>Item two</li>
<li>Item three</li>
</ol>Here's my 1st attempted CSS:
::marker {
user-select: all;
}This CSS still leaves out ::marker numbers when I copy a numbered list, so the issue persists across modern browsers.
Thank you for taking the time to read this and thank you in advance for any help!
Bion
"""
Note, for the purpose of an easy intuitive solution, it would be awesome to have that 1st attempted CSS work, but it's OK if there needs to be a different solution. And please let me know if there's already a fix for this issue!
- please link to the spec section you're talking about, or at least the spec
I'm unfamiliar with the structure of the spec, but it pertains to the::markerpseudoelement. I guess that means this:
https://drafts.csswg.org/css-pseudo-4/