mirror of
https://github.com/kennethreitz/kjvstudy.org.git
synced 2026-06-05 23:00:16 +00:00
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:
@@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user