Hacker News new | ask | show | jobs
by nyanpasu64 2066 days ago
Because they're defined via CSS ::before{content} and ::after{content} properties, and browsers don't make that text selectable for some reason.
2 comments

It's very useful when having stuff like that:

  <style type="text/css">
  .code-line::before {content: '>>> ';}
  </style>
  <div class="code-line">print 12</div>
  <div class="code-line">a = [i**2 for i in range(10)]</div>
Then the reader can copy the actual code without the interpreter's prompt.
When text-transform is used on an element, the copy-pasted text is the original text from the DOM, not the transformed version.

There needs to be a CSS property that makes the visible text selectable and copyable.

Preferably there would be a browser option to choose whether or not to do this in the menu for interacting with the selection. The CSS could set the default and the browser could allow you to override it when you're interacting with the text.