Sanitize rather than strip html
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
# @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("")
|
||||
// =>
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user