(text, maxLength = 160)
| 113 | } |
| 114 | |
| 115 | function getInlineTextSnippet(text, maxLength = 160) { |
| 116 | const normalized = (text || '').replace(/\s+/g, ' ').trim(); |
| 117 | if (!normalized) return ''; |
| 118 | if (normalized.length <= maxLength) return normalized; |
| 119 | return `${normalized.slice(0, maxLength)}...`; |
| 120 | } |
| 121 | |
| 122 | function getPageTextSnippet(maxLength = 240) { |
| 123 | const bodyText = document.body?.innerText || document.documentElement?.innerText || ''; |
no outgoing calls
no test coverage detected