* Extract CSS classes from HTML text. * @param {string} text * @returns {Set }
(text)
| 125 | * @returns {Set<string>} |
| 126 | */ |
| 127 | function extractCssClasses(text) { |
| 128 | const classes = new Set(); |
| 129 | const pattern = /\bclass\s*=\s*["']([^"']*)["']/gi; |
| 130 | let match; |
| 131 | while ((match = pattern.exec(text)) !== null) { |
| 132 | match[1].split(/\s+/).filter(Boolean).forEach(c => classes.add(c)); |
| 133 | } |
| 134 | return classes; |
| 135 | } |
| 136 | |
| 137 | /** |
| 138 | * Extract element IDs from HTML text. |