🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more
Socket
Book a DemoInstallSign in
Socket

sanitize-xml

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sanitize-xml

‘sanitize-xml’ simply sanitizes xml. Works in both Node.js and the browser. No dependencies.

Source
npmnpm
Version
1.5.19
Version published
Maintainers
1
Created
Source

sanitize-xml

‘sanitize-xml’ simply sanitizes xml. Works in both Node.js and the browser. No dependencies.

Install

NPM

npm install sanitize-xml

CDN

<script type="text/javascript" src="https://cdn.rawgit.com/jackens/sanitize-xml/master/sanitize-xml.js"></script>

Usage

const sanitizeXml = require('sanitize-xml')
sanitizeXml(someXmlString, options)

Defaults:

{
  allowedTags: { a: { href: true }, b: {}, blockquote: {}, br: {}, del: {}, div: {}, em: {}, figcaption: {}, figure: {}, font: {}, h1: {}, h2: {}, h3: {}, h4: {}, h5: {}, h6: {}, hr: {}, i: {}, img: { src: true, alt: true }, li: {}, ol: {}, p: {}, s: {}, span: {}, strong: {}, sub: {}, sup: {}, table: {}, tbody: {}, td: {}, tfoot: {}, th: {}, thead: {}, tr: {}, u: {}, ul: {} },
  caseInsensitiveTags: true,
  caseInsensitiveAttributes: true,
  removeComments: true
}

More usage examples: https://github.com/jackens/sanitize-xml/blob/master/test.js.

Keywords

sanitize-xml

FAQs

Package last updated on 18 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts