From 56ebb2046b48ade850622e4eaac1e6149aa784fe Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 7 Jun 2026 12:54:03 -0400 Subject: [PATCH] Normalize Unicode line separators on paste MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Google's lyrics box ships U+2028/U+2029 between lines, which a textarea collapses — verses arrived as one giant line. All line- separator flavors (CR, CRLF, LS, PS, NEL, VT, FF) normalize to \n, and the Lyrics/Songwriters/Musixmatch furniture strips with the rest. Co-Authored-By: Claude Opus 4.8 (1M context) --- static/index.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/static/index.html b/static/index.html index 1a57836..180dbdd 100644 --- a/static/index.html +++ b/static/index.html @@ -998,7 +998,9 @@ function extractAZBlock(t){ return block ? block + '\n' : null; } function cleanPaste(t){ - t = t.replace(/[\u2018\u2019\u02BC]/g, "'") + t = t.replace(/\r\n?/g, '\n') + .replace(/[\u2028\u2029\u0085\u000B\u000C]/g, '\n') // Google's lyrics box + .replace(/[\u2018\u2019\u02BC]/g, "'") .replace(/[\u201C\u201D]/g, '"') .replace(/\u00A0/g, ' '); const extracted = extractLyricBlock(t) || extractAZBlock(t); @@ -1011,6 +1013,8 @@ function cleanPaste(t){ if(/^Translations$/i.test(s)) return; if(/^You might also like/i.test(s)) return; if(/^Source:\s/i.test(s)) return; + if(/^Songwriters?:/i.test(s)) return; + if(/^Musixmatch$/i.test(s)) return; if(/^\d*\s*Embed$/.test(s)) return; out.push(l); });