Sanitize rather than strip html

This commit is contained in:
Jon Staab
2024-06-11 12:41:56 -07:00
parent 289d2fb8f9
commit 9c9e483f01
6 changed files with 35 additions and 39 deletions
+8
View File
@@ -1,3 +1,11 @@
# @welshman/content [![version](https://badgen.net/npm/v/@welshman/content)](https://npmjs.com/package/@welshman/content)
Utilities for parsing note content.
```typescript
import {truncate, parse, render} from '@welshman/content'
const content = "Hello<br>from https://coracle.tools! <script>alert('evil')</script>"
const html = truncate(parse({content})).map(render).join("")
// =>
```