Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dom-serializer

Package Overview
Dependencies
Maintainers
3
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dom-serializer - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

LICENSE

22

index.js

@@ -98,12 +98,5 @@ /*

wbr: true,
//common self closing svg elements
path: true,
circle: true,
ellipse: true,
line: true,
rect: true,
use: true
};
var render = module.exports = function(dom, opts) {

@@ -136,2 +129,5 @@ if (!Array.isArray(dom) && !dom.cheerio) dom = [dom];

function renderTag(elem, opts) {
// Handle SVG
if (elem.name === "svg") opts = {decodeEntities: opts.decodeEntities, xmlMode: true};
var tag = '<' + elem.name,

@@ -145,4 +141,4 @@ attribs = formatAttrs(elem.attribs, opts);

if (
opts.xmlMode &&
(!elem.children || elem.children.length === 0)
opts.xmlMode
&& (!elem.children || elem.children.length === 0)
) {

@@ -152,3 +148,5 @@ tag += '/>';

tag += '>';
tag += render(elem.children, opts);
if (elem.children) {
tag += render(elem.children, opts);
}

@@ -160,4 +158,2 @@ if (!singleTag[elem.name] || opts.xmlMode) {

return tag;

@@ -164,0 +160,0 @@ }

{
"name": "dom-serializer",
"version": "0.0.1",
"version": "0.1.0",
"description": "render dom nodes to string",

@@ -16,2 +16,5 @@ "author": "Felix Boehm <me@feedic.com>",

"main": "./index.js",
"files": [
"index.js"
],
"dependencies": {

@@ -22,11 +25,13 @@ "domelementtype": "~1.1.1",

"devDependencies": {
"mocha": "*",
"cheerio": "*",
"expect.js": "~0.3.1",
"jshint": "~2.3.0",
"lodash": "~2.4.1",
"jshint": "~2.3.0",
"cheerio": "*"
"mocha": "*",
"xyz": "0.4.x"
},
"scripts": {
"test": "mocha test.js"
}
},
"license": "MIT"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc