(cls: string)
| 231 | |
| 232 | /** Trusted CSS class name(s) — must match [a-zA-Z0-9_-\s] only. */ |
| 233 | export 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. */ |
| 239 | export function safeCssValue(val: string): SafeHtml { |