(depth, breadth)
| 74 | /* ------------------------------------------------------------------ */ |
| 75 | |
| 76 | function deepTree(depth, breadth) { |
| 77 | // Nested structure exercising the element walk; text-only leaves |
| 78 | // exercise the SAFE_FOR_XML innerHTML/textContent probes. |
| 79 | let html = ''; |
| 80 | const open = []; |
| 81 | const build = (d) => { |
| 82 | if (d === 0) { |
| 83 | html += '<p>leaf text node without any markup characters</p>'; |
| 84 | return; |
| 85 | } |
| 86 | |
| 87 | html += `<div class="level-${d}">`; |
| 88 | open.push('</div>'); |
| 89 | for (let i = 0; i < breadth; i++) { |
| 90 | build(d - 1); |
| 91 | } |
| 92 | |
| 93 | html += open.pop(); |
| 94 | }; |
| 95 | |
| 96 | build(depth); |
| 97 | return html; |
| 98 | } |
| 99 | |
| 100 | function wideAttrs(n) { |
| 101 | // Attribute-heavy flat list: exercises _sanitizeAttributes / |
no test coverage detected
searching dependent graphs…