{"_id":"bleach","_rev":"22-1d527bfea22c3f2f83d7bdfa0a6282fc","name":"bleach","description":"A minimalistic HTML sanitizer","dist-tags":{"latest":"0.3.0"},"versions":{"0.0.0":{"author":{"name":"Cam Pedersen","email":"cam@onswipe.com","url":"http://campedersen.com/"},"name":"bleach","description":"A minimalistic HTML sanitizer","version":"0.0.0","homepage":"https://github.com/ecto/bleach/issues","repository":{"type":"git","url":"git://github.com/ecto/bleach.git"},"main":"index.js","engines":{"node":"*"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/TRON/.npm/bleach/0.0.0/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"bleach@0.0.0","_engineSupported":true,"_npmVersion":"1.0.28","_nodeVersion":"v0.4.10","_defaultsLoaded":true,"dist":{"shasum":"4c8c1e8e2dfcfaca2e12dcd60254bb9f640f5270","tarball":"https://registry.npmjs.org/bleach/-/bleach-0.0.0.tgz","integrity":"sha512-N13VA08CNFKQltOJGPZrz4Giq4gSTKtsWFZis9ebfMMtZhURShgvw5kamIDQ7PwmvE7NfRCXPBeR0ZltWph7xA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCfYBxJJNe49pKhtmfsadj6n3kO0BWvbwiG9hLNd4gL/AIgIJ7NbBEsCxO70Z7/KzThcmA/UWISQ9sBvnj0OayLoqM="}]},"maintainers":[{"name":"ecto","email":"diffference@gmail.com"}],"directories":{}},"0.1.0":{"author":{"name":"Cam Pedersen","email":"cam@onswipe.com","url":"http://campedersen.com/"},"name":"bleach","description":"A minimalistic HTML sanitizer","version":"0.1.0","homepage":"https://github.com/ecto/bleach/issues","repository":{"type":"git","url":"git://github.com/ecto/bleach.git"},"main":"index.js","engines":{"node":"*"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/TRON/.npm/bleach/0.1.0/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"bleach@0.1.0","_engineSupported":true,"_npmVersion":"1.0.28","_nodeVersion":"v0.4.10","_defaultsLoaded":true,"dist":{"shasum":"76d81043b40854578ac25852eaf88be57cdc7073","tarball":"https://registry.npmjs.org/bleach/-/bleach-0.1.0.tgz","integrity":"sha512-yfC683eyCF6NIS6aueOkMAMIWEYiH3pKKgy3L4HqL5rUwDpoZvD6IIMnEBdl3B8G85HrdKO8uIsKcNi2w/Wxjw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD1rLPY9icfpdhDSRfLX0cd/e4Kj8MT6cXrpqduT6wPRwIgSajmLQ9g5qklwR3N7twuCp8cZYBXQxInK0OXZYsVW3Y="}]},"maintainers":[{"name":"ecto","email":"diffference@gmail.com"}],"directories":{}},"0.1.1":{"author":{"name":"Cam Pedersen","email":"cam@onswipe.com","url":"http://campedersen.com/"},"name":"bleach","description":"A minimalistic HTML sanitizer","version":"0.1.1","homepage":"https://github.com/ecto/bleach/issues","repository":{"type":"git","url":"git://github.com/ecto/bleach.git"},"main":"index.js","engines":{"node":"*"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/TRON/.npm/bleach/0.1.1/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"bleach@0.1.1","_engineSupported":true,"_npmVersion":"1.0.28","_nodeVersion":"v0.4.10","_defaultsLoaded":true,"dist":{"shasum":"801e2f86dbf79bfa002d77a9e1ded8e7c8a19ff1","tarball":"https://registry.npmjs.org/bleach/-/bleach-0.1.1.tgz","integrity":"sha512-0EJAPK471NXmTYiUooESSu/eEs18uDTVyuM4V+kk/q5yQQBdhplWPZ+FWG//RYHfIPXirjJdUIJKAC+qI70dKg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDf99vtNbpAyG4PQMWNLCCV8sK/VqPf3CeBoSVTtQTh8wIgKxXfZpImykQPqYi1zYwnCQx8y8wUTVsJSE6pQse2CbA="}]},"maintainers":[{"name":"ecto","email":"diffference@gmail.com"}],"directories":{}},"0.1.2":{"author":{"name":"Cam Pedersen","email":"cam@onswipe.com","url":"http://campedersen.com/"},"name":"bleach","description":"A minimalistic HTML sanitizer","version":"0.1.2","homepage":"https://github.com/ecto/bleach/issues","repository":{"type":"git","url":"git://github.com/ecto/bleach.git"},"main":"index.js","engines":{"node":"*"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/TRON/.npm/bleach/0.1.2/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"bleach@0.1.2","_engineSupported":true,"_npmVersion":"1.0.28","_nodeVersion":"v0.4.10","_defaultsLoaded":true,"dist":{"shasum":"fdaa7bb60e8355fd355d7b218f9797e26884e351","tarball":"https://registry.npmjs.org/bleach/-/bleach-0.1.2.tgz","integrity":"sha512-XpJawHGgfF6OapoD9rVHr+cClDG45Mmvdn9N0rz41lIn7rMZUFvUkc90Q6Vg4y1kI67OUSDJTxHykLBslXggcQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCiv1pmvl0l3x9P4mFHo9dXA4kFYWoDJuLklZEztOWxbwIgJsdLS3ZsOLCLz3ZUBA0xgmD6lzd0A0kS/gew2cLaDQ0="}]},"maintainers":[{"name":"ecto","email":"diffference@gmail.com"}],"directories":{}},"0.1.3":{"author":{"name":"Cam Pedersen","email":"cam@onswipe.com","url":"http://campedersen.com/"},"name":"bleach","description":"A minimalistic HTML sanitizer","version":"0.1.3","homepage":"https://github.com/ecto/bleach/issues","repository":{"type":"git","url":"git://github.com/ecto/bleach.git"},"main":"index.js","engines":{"node":"*"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/ecto/.npm/bleach/0.1.3/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"bleach@0.1.3","_engineSupported":true,"_npmVersion":"1.0.18","_nodeVersion":"v0.4.11-pre","_defaultsLoaded":true,"dist":{"shasum":"95237b599db766cf6a42370f90cc23d898a5ef39","tarball":"https://registry.npmjs.org/bleach/-/bleach-0.1.3.tgz","integrity":"sha512-H7SrJxBATpM45evph7BNAnDb98cpF6mSDVIxekAV4Jt+oYna/nKBhxvFU28ADJiRh1gSyQCH5Sjg90FfjD4Tlw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHqvt8LfD8aDNllAUsPXckgSHEamJWEX7RLAK2iUw0MHAiB1Cu/F/YTa4VpVn6B9AsN9vhMYWZYLWUfkHyiLtRrpyw=="}]},"scripts":{},"maintainers":[{"name":"ecto","email":"diffference@gmail.com"}],"directories":{}},"0.1.4":{"author":{"name":"Cam Pedersen","email":"cam@onswipe.com","url":"http://campedersen.com/"},"name":"bleach","description":"A minimalistic HTML sanitizer","version":"0.1.4","homepage":"https://github.com/ecto/bleach/issues","repository":{"type":"git","url":"git://github.com/ecto/bleach.git"},"main":"index.js","engines":{"node":"*"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/TRON/.npm/bleach/0.1.4/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"bleach@0.1.4","_engineSupported":true,"_npmVersion":"1.0.28","_nodeVersion":"v0.4.10","_defaultsLoaded":true,"dist":{"shasum":"26daecab9ee61a445abd74f70d6594f885c130f8","tarball":"https://registry.npmjs.org/bleach/-/bleach-0.1.4.tgz","integrity":"sha512-QnE0BteOrvcPqODI/kADb0vZUtlnPYY9BKGAfa/MQyU37KWaWf5aI1lrL7TWCOUHTZxB8me2rBJN2f2FpnxFfg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID7FnTvqMBW02ugtmkRvsqzYWzM5Tux4wEQM/AsxMQo+AiEAum6bkZARo4L/W2u0UNo1u47Ayj/d8gZ/gVraLGkrK5I="}]},"maintainers":[{"name":"ecto","email":"diffference@gmail.com"}],"directories":{}},"0.2.0":{"author":{"name":"Cam Pedersen","email":"cam@onswipe.com","url":"http://campedersen.com/"},"name":"bleach","description":"A minimalistic HTML sanitizer","version":"0.2.0","homepage":"https://github.com/ecto/bleach/issues","repository":{"type":"git","url":"git://github.com/ecto/bleach.git"},"main":"index.js","engines":{"node":"*"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/TRON/.npm/bleach/0.2.0/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"bleach@0.2.0","_engineSupported":true,"_npmVersion":"1.0.28","_nodeVersion":"v0.4.10","_defaultsLoaded":true,"dist":{"shasum":"8bddf4f413286370c330c92b5c76f11da32fb538","tarball":"https://registry.npmjs.org/bleach/-/bleach-0.2.0.tgz","integrity":"sha512-Bfdix7I6F7+TlQCrqnBv6hUIAO/6Xls9D4R1Y1OdmRWx611j71IEk5Wju6Q7qvMWLD7+zdPodp4zZ/jlgSAK4Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB100vYq54qkxfeqnsouxtXufLLE+kEXyKtXHtgLkSliAiEAlxMsEn4E9E7FWXYS+f7dKG6gUZtxKRqQW11PH4IDKG4="}]},"maintainers":[{"name":"ecto","email":"diffference@gmail.com"}],"directories":{}},"0.2.1":{"author":{"name":"Cam Pedersen","email":"cam@onswipe.com","url":"http://campedersen.com/"},"name":"bleach","description":"A minimalistic HTML sanitizer","version":"0.2.1","homepage":"https://github.com/ecto/bleach/issues","repository":{"type":"git","url":"git://github.com/ecto/bleach.git"},"main":"index.js","engines":{"node":"*"},"dependencies":{"ent":"0.0.x"},"devDependencies":{"vows":"0.5.x"},"_npmUser":{"name":"ecto","email":"diffference@gmail.com"},"_id":"bleach@0.2.1","_engineSupported":true,"_npmVersion":"1.0.102","_nodeVersion":"v0.4.10","_defaultsLoaded":true,"dist":{"shasum":"693a4375849fb9debc29f2bca03e0eb8564e8946","tarball":"https://registry.npmjs.org/bleach/-/bleach-0.2.1.tgz","integrity":"sha512-kOBQGnQflvN63h0EDOYb61w1OEH6+4Su/6VB1KoyZsZSDZslsMIYkJ8CUU4LO3qfcJZIu4wu5OEjfTgd6JuP2Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1WGvYMDxplstRjhkA79edb5GIR8SBz1JuWQPBf6Y3TwIhALeTLrpYjmvpZ7L2owURr8F+L3BJ4AAUMr3Ifv8GO50I"}]},"maintainers":[{"name":"ecto","email":"diffference@gmail.com"}],"directories":{}},"0.3.0":{"author":{"name":"Cam Pedersen","email":"cam@onswipe.com","url":"http://campedersen.com/"},"name":"bleach","description":"A minimalistic HTML sanitizer","version":"0.3.0","homepage":"https://github.com/ecto/bleach/issues","repository":{"type":"git","url":"git://github.com/ecto/bleach.git"},"main":"index.js","engines":{"node":"*"},"dependencies":{"he":"0.4.x"},"devDependencies":{"vows":"0.5.x"},"bugs":{"url":"https://github.com/ecto/bleach/issues"},"_id":"bleach@0.3.0","_shasum":"ae414350c56d2ddb61e5bc7596a2fd4c1200e15f","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"ecto","email":"diffference@gmail.com"},"maintainers":[{"name":"ecto","email":"diffference@gmail.com"}],"dist":{"shasum":"ae414350c56d2ddb61e5bc7596a2fd4c1200e15f","tarball":"https://registry.npmjs.org/bleach/-/bleach-0.3.0.tgz","integrity":"sha512-umFRejCk6J4u3Q1LdhgFPKBkmhMGiU9kyTxmiCWZpcd2g7WRIM+HPaAHrEOOmO+U+0T3nHO2v9G0FsbmUNZxwg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF+2l/lSzRoLDpNlatD4pt8ghpng7oPj6rdxP3cUJQ9SAiEAnGx/IVoPlIfTtmPaNBy0dqouJtRhMW00Jw/6fLOeNo4="}]},"directories":{}}},"maintainers":[{"name":"ecto","email":"diffference@gmail.com"}],"time":{"modified":"2022-06-13T04:46:16.002Z","created":"2011-09-22T21:09:37.565Z","0.0.0":"2011-09-22T21:09:37.931Z","0.1.0":"2011-09-22T21:59:10.190Z","0.1.1":"2011-09-27T00:32:45.340Z","0.1.2":"2011-09-29T23:46:49.353Z","0.1.3":"2011-10-16T20:16:33.043Z","0.1.4":"2011-10-17T19:37:42.487Z","0.2.0":"2011-10-17T21:53:48.400Z","0.2.1":"2011-11-17T02:35:34.242Z","0.3.0":"2014-06-11T15:33:54.501Z"},"author":{"name":"Cam Pedersen","email":"cam@onswipe.com","url":"http://campedersen.com/"},"repository":{"type":"git","url":"git://github.com/ecto/bleach.git"},"readme":"# bleach\n\nSanitize your HTML the easy way!\n\n![bleach](http://i.imgur.com/9qSfd.png)\n\n## install\n\n    npm install bleach\n\n## test\n\n    vows --spec test/*\n\n## example\n\nBasic:\n\n````javascript\n\nvar bleach = require('bleach');\n\nvar html = bleach.sanitize(aBunchOfHTML);\n\nconsole.log(html);\n````\n\nAdvanced:\n\n````javascript\n\nvar bleach = require('bleach');\n\nvar whitelist = [\n  'a',\n  'b',\n  'i',\n  'em',\n  'strong'\n]\n\nvar options = {\n  mode: 'white',\n  list: whitelist\n}\n\nvar html = bleach.sanitize(aBunchOfHTML, options);\n\nconsole.log(html);\n````\n\n## usage\n\n### bleach.sanitize(html, options)\n\nRuns HTML through sanitizer and returns sanitized HTML as string.\n\n`options` may contain the following optional attributes:\n\n*   `mode` may be set to `'white'` or `'black'`\n*   `list` is an array containing tags to match against\n\n`white`mode will remove all tags from `html`, excluding those in `list`\n\n`black`mode will remove all tags found in `list` that are found in `html`\n\n### bleach.analyze(html)\n\nWill extract all tags from HTML and return an array of JSON objects. Example return:\n\n````javascript\n[\n  {\n    full: '<div id=\"post-119477\">',\n    name: 'div',\n    attr: [\n      \"id\": \"post-119477\"\n    ]\n  },\n  ...\n]\n````\n\n### bleach.filter(html, filters)\n\nSEXY FUN TIME\n\n````javascript\n\nvar nyanFilter = function(input){\n  return input.replace('cats', 'nyannyannyan');\n}\n\nconsole.log(\n  bleach.filter('cats', nyanFilter)\n);\n\n// nyannyannyan\n\n````\n\n````javascript\n\nvar cutFilter = function(input){\n  return input.slice(0, 3);\n}\n\nconsole.log(\n  bleach.filter('cats', [\n    nyanFilter,\n    cutFilter\n  ])\n);\n\n// nyan\n\n````\n\nYou may also define longer filters and include them in the ./node_modules/bleach/filters directory.\nA sample filter is included to convert YouTube flash embed objects to iDevice-compatible YouTube iframes.\n\n````javascript\n\nvar html = '<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" width=\"420\" height=\"315\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0\"><param name=\"allowFullScreen\" value=\"true\"><param name=\"allowscriptaccess\" value=\"always\"><param name=\"src\" value=\"http://www.youtube.com/v/aU079Mdkenw?version=3&amp;hl=en_US\"><param name=\"allowfullscreen\" value=\"true\"><embed type=\"application/x-shockwave-flash\" width=\"420\" height=\"315\" src=\"http://www.youtube.com/v/aU079Mdkenw?version=3&amp;hl=en_US\" allowscriptaccess=\"always\" allowfullscreen=\"true\" id=\"s_media_1_0\" name=\"s_media_1_0\"></object>';\n\nconsole.log(\n  bleach.filter(html, 'youtube')\n);\n\n// <iframe type=\"text/html\" frameborder=\"0\" scrolling=\"no\" allowfullscreen src=\"http://youtube.com/embed/aU079Mdkenw\"></iframe>\n\n````\n\nRefer to the filters directory for the template.\n\n## disclaimer\n\nThis is not a port of the Python **bleach** library - in fact their implementations are very different.\n\n## license\n\n(The MIT License)\n\nCopyright (c) 2011 Cam Pedersen <cam@onswipe.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","homepage":"https://github.com/ecto/bleach/issues","bugs":{"url":"https://github.com/ecto/bleach/issues"},"readmeFilename":"README.md","users":{"morewry":true}}