Socket
Socket
Sign inDemoInstall

hast-util-from-parse5

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hast-util-from-parse5 - npm Package Compare versions

Comparing version 4.0.1 to 4.0.2

9

index.js

@@ -6,2 +6,4 @@ 'use strict'

var find = require('property-information/find')
var ns = require('web-namespaces')
var s = require('hastscript/svg')
var h = require('hastscript')

@@ -52,4 +54,4 @@ var xtend = require('xtend')

if (fn === element && schema.space === 'html' && ast.nodeName === 'svg') {
config.schema = svg
if (fn === element) {
config.schema = ast.namespaceURI === ns.svg ? svg : html
}

@@ -136,2 +138,3 @@

function element(ast, children, config) {
var fn = config.schema.space === 'svg' ? s : h
var name = ast.tagName

@@ -155,3 +158,3 @@ var attributes = ast.attrs

node = h(name, props, children)
node = fn(name, props, children)

@@ -158,0 +161,0 @@ if (name === 'template' && 'content' in ast) {

{
"name": "hast-util-from-parse5",
"version": "4.0.1",
"version": "4.0.2",
"description": "Transform Parse5’s AST to HAST",

@@ -25,2 +25,3 @@ "license": "MIT",

"property-information": "^4.0.0",
"web-namespaces": "^1.1.2",
"xtend": "^4.0.1"

@@ -27,0 +28,0 @@ },

@@ -67,4 +67,5 @@ # hast-util-from-parse5 [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov]

If an `svg` element is found in the HTML space, `toHTML` automatically switches
to the SVG space when entering the element, and switches back when leaving.
If an element in with the SVG namespace is found in `ast`, `fromParse5`
automatically switches to the SVG space when entering the element, and
switches back when leaving.

@@ -71,0 +72,0 @@ ###### `options.file`

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