Non-copyable line numbers in HTML elements
Similar to #180 (closed), I'd like to have the ability to easily copy source without getting line numbers, but not using list output.
It looks like the user-select CSS property was added in hopes of doing this, but all that really does is prevent a selection from starting on that element, and visually hides the selection, but when copying and pasting, that text is still included.
GitHub and others use a technique where they set the content of the ::before pseudo element (which is not within the normal text-selection flow). Different approaches are taken for what the content is, with some using a CSS increment value, but I think the easiest one to adapt while still maintaining line-wrapping numbering and padding is to set a data-linenumber attribute on the <span> instead of setting the inner text content of the span, and then set .hl.lin::before { content: attr(data-linenumber); }