1.25.0 • Published 4 years ago

sanitize-html-hacked v1.25.0

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

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>';