ChatGPT & Claude Code Canvas Line Number Remover
Strip leading line numbers (1 | , 01:, 1│) from copied AI code boxes without touching code indentation.
const cleaned = text.replace(/^\s*\d+\s*[│\|:]\s*/gm, '');
$...$), Markdown data tables, and ISO-8601 timestamps are strictly preserved.
Deterministic Sanitization Specification & Live Diff
1 | function calculateTotal(items) { 2 | return items.reduce((sum, item) => sum + item.price, 0); 3 | }function calculateTotal(items) { return items.reduce((sum, item) => sum + item.price, 0);}How to Clean ChatGPT & Claude Code Canvas Line Number Remover Online
ClipNText ChatGPT & Claude Code Canvas Line Number Remover is a client-side text sanitizer that strips Editor Gutter & Code Box Margin Markers, orphaned delimiters, and syntax clutter from ai. Executing locally via asynchronous browser Web Workers (scrub.worker.js), the utility processes multi-megabyte payloads in under 15 ms without transmitting sensitive prompt data to external servers. Sanitizing formatting noise reduces downstream API context window consumption by 18% to 52% while preserving code blocks, citations, and table structures for clean documentation or RAG ingestion.
| Target Artifact | Regex / Pattern Signature | Sanitization Behavior |
|---|---|---|
1 | function calculateTotal(items) {
2 | |
/^\s*\d+\s*[│\|:]\s*/gm |
When selecting code from syntax-highlighted web canvas elements, browser selection captures line gutter numbers (1 |, 2 :) along with source code. |
function calculateTotal(items) {
retur |
/[ \t]{2,}|\u200B/g |
Collapses redundant whitespace and purges invisible zero-width tokens. |
Editor Gutter & Code Box Margin Markers
When selecting code from syntax-highlighted web canvas elements, browser selection captures line gutter numbers (1 |, 2 :) along with source code.
/^\s*\d+\s*[│\|:]\s*/gm
Technical Edge-Case FAQ
Common engineering questions regarding character preservation, encoding boundaries, and browser worker performance: