Prepend page headings to resource spacebar reading

This commit is contained in:
2025-11-30 11:44:46 -05:00
parent 619eaf8070
commit a4373efa58
+8
View File
@@ -1853,6 +1853,14 @@
return (el.textContent || '').trim().length > 10;
});
var textBlocks = [];
var titleEl = document.querySelector('h1');
if (titleEl && (titleEl.textContent || '').trim().length > 0) {
textBlocks.push(titleEl);
}
var subtitleEl = document.querySelector('.subtitle');
if (subtitleEl && (subtitleEl.textContent || '').trim().length > 0) {
textBlocks.push(subtitleEl);
}
// If a specific element is highlighted, read only that; otherwise read all concatenated
if (highlighted) {
textBlocks = [highlighted];