What to do when Excerpt captured line numbers from a code viewer and a paste will not run
If Excerpt captured line numbers from a code viewer, recapture inside the code, strip the gutter in your editor, and do not paste the numbered file.
Also on Microsoft Edge Add-ons
Documentation and repo viewers often show a gutter of line numbers that look like part of the text when you drag a selection. If Excerpt captured line numbers from a code viewer, the paste will not run, diffs will be messy, and you should recapture inside the code, strip the gutter in your editor, and never treat the numbered file as the runnable source.
This is not the Copy-button page, not the mid-token wrap page, and not a general docs-clipping guide. The job is a numeric gutter saved as if it were part of the code. The capture path is the web clipper workflow for what is actually visible on the page.
When Excerpt captured line numbers from a code viewer, recapture inside the code
- In preview, look at the left edge of the snippet. If each line starts with 1, 2, 3 (or a similar gutter), the selection included the viewer chrome.
- Recapture from the first real token, staying to the right of the gutter if the page allows it. On some docs sites a tighter selection is enough; on others you will need to strip numbers in an editor after export.
- Keep Markdown or a cleaned editor buffer as the file you will paste or commit. Use the PDF only as a reading copy of how the docs looked.
- If you already shared a numbered paste, send a cleaned file and say not to run the earlier one.
Honest limits
- Excerpt cannot always ignore a gutter when the site rendered line numbers as ordinary text.
- Copy-button chrome and mid-token wrapping are different symptoms.
- Official raw files or a repo blob without a gutter, when available, beat a cleaned-up viewer clip.
If you want a local file rather than another cloud clipboard, install Excerpt in Chrome or Edge. Multi-select the blocks, export PDF or Markdown, and find them later in the on-device IndexedDB library. Free includes 100 clippings and 5 tags; Pro is $29 one-time for unlimited clippings and backup import/export. Do not expect a log-in, a family sync channel, or a built-in AI summary—those are not shipped features.
Prefer the official raw or repo file when you need to run or commit the code. Use a viewer clip when you also needed the surrounding explanation, and clean the gutter before anyone pastes the block.
GitHub, GitLab, docs.rs, and many API docs share this failure mode. If a page offers a raw view, open that and clip from there. If you only needed two lines from a long file, clip those lines and the filename, not the entire numbered listing. A reading PDF of a long file can keep the numbers; a runnable export should not.
Prefer Chrome? Use the official Chrome Web Store listing. Prefer Edge? Use the official Microsoft Edge Add-ons listing. Either way, the searchable library is local to that browser profile.
FAQ
Can I leave the line numbers in for a reading copy?
Yes, if the file is only for reading and you say so. Strip them before anyone pastes or commits the block.
How is this different from a Copy button in the clip?
A Copy button is a toolbar widget. This page is a numeric gutter saved at the start of each line.
Related guides
Install Excerpt and save your next clip as a clean PDF
Free: up to 100 clippings and 5 tags. Pro is $29 one-time for unlimited + library backup import/export.