You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is inconvenient for people wanting to copy-paste the code, e.g. to reproduce the results: they have to manually remove the >>> and .... Lately, I've noticed snippets on Read the Docs where the >>> and ... are conveniently excluded from the selection. I have looked at the CSS of this snippet, and adding the following to css.mako seems to do the trick:
I'm not sure about the impact of making hljs-meta tags not user-selectable across the board, but to me this seems sufficiently useful a feature to at least deserve a config entry. If this needs further investigation, I'm happy to have a deeper look and make a pull request 😄.
The text was updated successfully, but these errors were encountered:
On Firefox 95.0, the hljs-meta spans are replaced with blank lines when the text is copied (this also happens in the Read the Docs snippet I linked previously, so I think it's an issue with user-select: none, perhaps specifically inside HTML <code> tags). On latest Chrome/Edge it works fine.
I tried the following, but it doesn't fix this issue on Firefox:
Is there an issue with making .hljs-meta tags not user-selectable as you proposed? I think it a legitimate request, and it should find its way into the codebase eventually. 😄
Currently, the
>>>
and...
in Python REPL snippets are selectable in HTML docs (much as they are here, on Github):This is inconvenient for people wanting to copy-paste the code, e.g. to reproduce the results: they have to manually remove the
>>>
and...
. Lately, I've noticed snippets on Read the Docs where the>>>
and...
are conveniently excluded from the selection. I have looked at the CSS of this snippet, and adding the following tocss.mako
seems to do the trick:I'm not sure about the impact of making
hljs-meta
tags not user-selectable across the board, but to me this seems sufficiently useful a feature to at least deserve a config entry. If this needs further investigation, I'm happy to have a deeper look and make a pull request 😄.The text was updated successfully, but these errors were encountered: