---
url: /api/packages/utils/src/functions/sanitizeSvg.md
---
[pantoken-root](../../../../index.md) / [packages/utils/src](../index.md) / sanitizeSvg

# Function: sanitizeSvg()

> **sanitizeSvg**(`svg`): `string`

Beta

Strip `<script>` elements and event-handler attributes from SVG markup.

Defense-in-depth for SVG decoded from vendored data URIs or contributed by plugins.
Not a full HTML parser — relies on the upstream source being trusted and pinned.

## Parameters

### svg

`string`

## Returns

`string`
