Files
gpustack-ui/src/components/highlight-code/utils.ts
T
2024-07-21 18:27:22 +08:00

9 lines
210 B
TypeScript

export function escapeHtml(value: string): string {
return value
.replace(/&/g, '&')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#x27;');
}