(target: string, root: Root)
| 59 | } |
| 60 | |
| 61 | function idMany(target: string, root: Root): Element[] { |
| 62 | if (!target) { |
| 63 | return [] |
| 64 | } |
| 65 | if (!/^\d/.test(target)) { |
| 66 | try { |
| 67 | return Array.from(root.querySelectorAll('#' + cssEscapeId(target))) |
| 68 | } catch (_e) { |
| 69 | return [] |
| 70 | } |
| 71 | } |
| 72 | return Array.from(root.querySelectorAll('*')).filter(el => el.getAttribute('id') === target) |
| 73 | } |
| 74 | |
| 75 | function getLinkText(el: Element): string { |
| 76 | const text = (el as HTMLElement).innerText !== undefined ? (el as HTMLElement).innerText : el.textContent || '' |
no test coverage detected