sanitize-html-hacked

1.25.0 • Public • Published

origin repo: https://github.com/apostrophecms/sanitize-html

I have hacked it to add disallowedStyles for special purpose.

const r = sanitizeHtml(
  "<span style='color: blue; text-align: justify; font-family: helvetica'></span>",
  {
    allowedTags: false,
    allowedAttributes: {
      span: ["style"],
    },
    disallowedStyles: ["text-align", "font-family"],
  }
);

r === '<span style="color:blue"></span>';

Package Sidebar

Install

npm i sanitize-html-hacked

Weekly Downloads

0

Version

1.25.0

License

MIT

Unpacked Size

1.62 MB

Total Files

7

Last publish

Collaborators

  • iamlane