dustjs-helper-htmlstrip

0.0.4 • Public • Published

htmlstrip helper

Strip HTML tags from a string using htmlstrip.

Definition

{@htmlstrip str="<p>Test</p>" script="false" style="false" /}

IFF script is true text inside script tags will be included. IFF style is true text inside style tags will be included.

Examples

{@htmlstrip str="<p>Test</p>" /} => Test
{@htmlstrip str="<p>Test</p><script>alert('xss')</script>" /} => Test
{@htmlstrip str="<p>Test</p><script>alert('xss')</script>" script="true" /} => Test alert('xss')

Usage

Depends on dustjs-helpers module to be loaded first since it adds it's definition to the the dust.helpers property.

In node.js: require('dustjs-helper-htmlstrip');

In browser:

If not using require, load the JS some other way and call it with the dust object. As noted earlier, dustjs-helpers must be loaded earlier.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.4
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.4
    0
  • 0.0.3
    0
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i dustjs-helper-htmlstrip

Weekly Downloads

0

Version

0.0.4

License

MIT

Last publish

Collaborators

  • framp