This package has been deprecated

Author message:

WARNING: We renamed this module to @webex/helper-html. Please install it instead. See https://github.com/webex/spark-js-sdk#the-cisco-webex-js-sdk for more information.

@ciscospark/helper-html

1.52.2 • Public • Published

@ciscospark/helper-html

standard-readme compliant

HTML filter for the Cisco Webex JS SDK. See https://webex.github.io/spark-js-sdk/

Note: This package relies on DOM apis and largely returns noops in node environments.

Install

npm install --save @ciscospark/helper-html

Usage

filter(allowedTags, allowedStyles, html)

Filters an html string such that it only includes the allowed tags and styles. Disallowed tags and styles are removed while their contents are kept.

allowedTags is an object keyed on tag name mapped to an array of attribuets allowed for that tag. allwedStyles is an array of allowed style string. html is a string.

Returns a promise that resolves with the new html string.

filterSync()

See filter()

filterEscape(processCallback, allowedTags, allowedStyles, html)

Filters an html string such that it only includes the allowed tags and styles. Disallowed tags and styles and their children are escaped.

processCallback synchronous callback that receives the body of the html fragment generated from html. Presents an opportunity to do preprocessing (e.g turn urls into links) without parsing html mulitple times allowedTags is an object keyed on tag name mapped to an array of attribuets allowed for that tag. allwedStyles is an array of allowed style string. html is a string.

Returns a promise that resolves with the new html string.

filterEscapeSync()

See filterEscape()

Maintainers

This package is maintained by Cisco Webex for Developers.

Contribute

Pull requests welcome. Please see CONTRIBUTING.md for more details.

License

© 2016-2018 Cisco and/or its affiliates. All Rights Reserved.

Readme

Keywords

none

Package Sidebar

Install

npm i @ciscospark/helper-html

Weekly Downloads

98

Version

1.52.2

License

MIT

Unpacked Size

59.1 kB

Total Files

16

Last publish

Collaborators

  • webex-jenkins
  • adamweeks