@mapbox/sanitize-caja

    0.1.4 • Public • Published

    Build Status

    sanitize-caja

    Sanitize HTML content using the Google Caja JsHtmlSanitizer and a set of basic assumptions, and a wrapper to make it all work in nodejs without global variable leaks and so on.

    This is a slightly 'loosened' version of Caja's restrictions, to allow for things like images, links, and a few HTML5 elements.

    api

    sanitize(html: string) -> sanitized string

    Sanitize a string of HTML content, returning a sanitized string.

    install

    npm install sanitize-caja
    

    example

    var sanitize = require('sanitize-caja');
     
    document.write(sanitize(evilUserInput));

    see also

    Keywords

    Install

    npm i @mapbox/sanitize-caja

    DownloadsWeekly Downloads

    3,629

    Version

    0.1.4

    License

    BSD-2-Clause

    Last publish

    Collaborators

    • mapbox-machine-user
    • mapbox-npm-ci
    • mapbox-npm-advanced-actions
    • mapbox-npm-09
    • mapbox-npm-08
    • mapbox-npm-07
    • mapbox-npm-06
    • mapbox-npm-05
    • mapbox-npm-04
    • mapbox-npm-03
    • mapbox-npm-02
    • mapbox-npm-01
    • mapbox-npm
    • mapbox-admin