Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bloomreach/spa-sdk

Package Overview
Dependencies
Maintainers
35
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bloomreach/spa-sdk - npm Package Compare versions

Comparing version 15.2.2-0 to 15.3.0

5

lib/index.d.ts

@@ -637,2 +637,7 @@ /**

toJSON(): any;
/**
* Sanitize HTML content to allow only safe HTML markups.
* @param content The HTML content to sanitize.
*/
sanitize(content: string): string;
}

@@ -639,0 +644,0 @@

9

package.json
{
"name": "@bloomreach/spa-sdk",
"version": "15.2.2-0",
"version": "15.3.0",
"description": "Bloomreach SPA SDK",

@@ -72,2 +72,3 @@ "keywords": [

"@types/node": "14.17.3",
"@types/sanitize-html": "2.3.2",
"@types/xmldom": "0.1.31",

@@ -93,5 +94,5 @@ "babel-plugin-transform-async-to-promises": "0.8.15",

"inversify": "5.1.1",
"reflect-metadata": "0.1.13"
},
"stableVersion": "15.2.1"
"reflect-metadata": "0.1.13",
"sanitize-html": "2.4.0"
}
}

@@ -78,2 +78,19 @@ # Bloomreach SPA SDK

### Rendering HTML content safely
The SPA SDK provides an API, ```Page.sanitize(html)```,
which sanitizes HTML content using the [sanitize-html](https://www.npmjs.com/package/sanitize-html) library,
to render the HTML content safely.
For example, in a React example, you may sanitize and render the HTML content which came from the backend like the following example:
```
{/* Suppose the content.value below contains HTML markups string. */}
<div>
{content && <div dangerouslySetInnerHTML={{ __html: page.rewriteLinks(page.sanitize(content.value)) }} />}
</div>
```
The same principle may apply in other frameworks. e.g, `v-html` in Vue.js or `[innerHTML]` in Angular.
## License

@@ -80,0 +97,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc