diff --git a/internal/web/static/paste-lines.js b/internal/web/static/paste-lines.js index 41537f9..aacab75 100644 --- a/internal/web/static/paste-lines.js +++ b/internal/web/static/paste-lines.js @@ -20,6 +20,13 @@ // box per line, which would shift every following number down one row (#167). function splitLines() { var html = body.innerHTML; + if (html.indexOf('\n') < 0) { + // No newline text nodes to split on (already joined in the server + // template or stripped upstream): blocks are already adjacent, so + // leave the DOM alone. Splitting here would clone the whole markup + // into one block and leave renumber() reading stale nodes (#205). + return; + } var parts = html.split('\n'); var out = []; for (var i = 0; i < parts.length; i++) {