Normalize whitespace when copying verse text

Collapses multiple spaces/newlines into single spaces for
cleaner clipboard content.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-12-02 20:19:52 -05:00
parent b0232d5473
commit aa0b940641
+5 -4
View File
@@ -748,12 +748,13 @@ document.addEventListener('DOMContentLoaded', function() {
// Remove sidenotes, marginnotes, labels, and verse number links
temp.querySelectorAll('.sidenote, .marginnote, .sidenote-number, .margin-toggle, .verse-number-link').forEach(el => el.remove());
// Get clean text
const cleanText = temp.textContent || temp.innerText || '';
// Get clean text and normalize whitespace
let cleanText = temp.textContent || temp.innerText || '';
cleanText = cleanText.replace(/\s+/g, ' ').trim();
if (cleanText.trim()) {
if (cleanText) {
e.preventDefault();
e.clipboardData.setData('text/plain', cleanText.trim());
e.clipboardData.setData('text/plain', cleanText);
}
});