mirror of
https://github.com/angular/angular.git
synced 2026-11-23 07:05:14 -05:00
The copy button read the whole block's `innerText` and then removed every
`\n\n\n` sequence, which dropped the blank lines between lines of code.
On blocks with line numbers, the same `innerText` also picked up the
number column, so pasting produced "1", the first line, "2", "3" and so
on.
Join the text of the visible `.line` elements instead. Line numbers sit
outside those elements, and lines hidden by an example's visible range
stay hidden, so the clipboard matches what the block shows.
The `.remove` branch goes with it, since no line has carried that class
since 8ec0a4ee5c dropped diff support from docs-code.