MCPcopy Index your code
hub / github.com/bigskysoftware/_hyperscript / extractCssClasses

Function extractCssClasses

tools/lsp/src/regions.js:127–135  ·  view source on GitHub ↗

* Extract CSS classes from HTML text. * @param {string} text * @returns {Set }

(text)

Source from the content-addressed store, hash-verified

125 * @returns {Set<string>}
126 */
127function 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.

Callers

nothing calls this directly

Calls 1

forEachMethod · 0.45

Tested by

no test coverage detected