0.1.0 • Published 2 years ago

preact-safe v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Preact Safe

This package is preact version of react-safe. It provides a syntactic sugar over the raw dangerouslySetInnerHTML.

Examples

Preact

<h1 dangerouslySetInnerHTML={{__html: page.title}}></h1>
<div dangerouslySetInnerHTML={{__html: renderMD(page.body)}}></div>

Preact Safe

<Safe.h1>{page.title}</Safe.h1>
<Safe.div>{renderMD(page.body)}</Safe.div>

Warning

Preact Safe is a thin wrapper over dangerouslySetInnerHTML. So all the usual concerns about XSS attacks and security in general apply. Check the above link for more information.

Author

preact-safe © Baoshuo, Released under the MIT License.
Authored and maintained by Baoshuo with help from contributors.

Personal Website · Blog · GitHub @renbaoshuo · Twitter @renbaoshuo

0.1.0

2 years ago

0.0.1

2 years ago

0.0.0

2 years ago