You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

rehype-dom-parse

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rehype-dom-parse - npm Package Compare versions

Comparing version

to
4.0.1

21

lib/index.js

@@ -31,2 +31,4 @@ /**

const DOCUMENT_FRAGMENT_NODE = 11
/**

@@ -37,13 +39,12 @@ * @param {string} htmlString

function createFragment(htmlString) {
const fragment = document.createDocumentFragment()
const temporary = document.createElement('body')
temporary.innerHTML = htmlString
let child = temporary.firstChild
const doc = createDocument('<!doctype html><body>' + htmlString)
while (child) {
fragment.append(child)
child = temporary.firstChild
}
return fragment
/**
* Pretend as a DocumentFragment node,
* @see https://github.com/rehypejs/rehype-dom/pull/19 for more details
*/
return /** @type {DocumentFragment} */ ({
nodeType: DOCUMENT_FRAGMENT_NODE,
childNodes: doc.body.childNodes
})
}

@@ -50,0 +51,0 @@

{
"name": "rehype-dom-parse",
"version": "4.0.0",
"version": "4.0.1",
"description": "rehype plugin to use browser APIs to parse HTML",

@@ -5,0 +5,0 @@ "license": "ISC",