MCPcopy Create free account
hub / github.com/microsoft/AI-Engineering-Coach / safeCssClass

Function safeCssClass

src/webview/shared.ts:233–236  ·  view source on GitHub ↗
(cls: string)

Source from the content-addressed store, hash-verified

231
232/** Trusted CSS class name(s) — must match [a-zA-Z0-9_-\s] only. */
233export function safeCssClass(cls: string): SafeHtml {
234 if (!/^[a-zA-Z0-9_\-\s]*$/.test(cls)) return rawHtml('');
235 return rawHtml(cls);
236}
237
238/** Trusted CSS value — rejects characters that could break out of style attributes. */
239export function safeCssValue(val: string): SafeHtml {

Callers 1

pctBadgeFunction · 0.85

Calls 1

rawHtmlFunction · 0.70

Tested by

no test coverage detected