Files
InvoiceShelf/resources/scripts/utils/markdown.ts
T
Darko Gjorgjijoski 0b9ae9ea00 refactor(ai): extract assistant into an official module (#749)
* feat(modules): expose host data boundaries

* feat(modules): add frontend extension surfaces

* refactor(ai): remove assistant from core

* chore(ai): prepare the module extraction

* fix(modules): load extension styles after the host bundle

* chore(modules): lock SDK 3.3.0
2026-08-05 22:10:21 +02:00

18 lines
581 B
TypeScript

import DOMPurify from 'dompurify'
/**
* Sanitize a raw HTML string with DOMPurify's default browser profile
* (strips <script>, event handlers, javascript: URLs, and every other HTML
* vector). Use this for HTML that originates from the server, a third-party
* module registry, or the update server before binding it via v-html — the
* `BaseSanitizedHtml` component wraps this so feature code never touches
* v-html directly.
*/
export function sanitizeHtml(html: string | null | undefined): string {
if (!html) {
return ''
}
return DOMPurify.sanitize(html)
}