Socket
Socket
Sign inDemoInstall

mdast-util-to-hast

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mdast-util-to-hast - npm Package Compare versions

Comparing version 3.0.1 to 3.0.2

lib/revert.js

14

lib/handlers/image-reference.js

@@ -6,3 +6,3 @@ 'use strict'

var normalize = require('mdurl/encode')
var failsafe = require('../failsafe')
var revert = require('../revert')

@@ -12,9 +12,15 @@ /* Transform a reference to an image. */

var def = h.definition(node.identifier)
var props = {src: normalize((def && def.url) || ''), alt: node.alt}
var props
if (def && def.title !== null && def.title !== undefined) {
if (!def) {
return revert(h, node)
}
props = {src: normalize(def.url || ''), alt: node.alt}
if (def.title !== null && def.title !== undefined) {
props.title = def.title
}
return failsafe(h, node, def) || h(node, 'img', props)
return h(node, 'img', props)
}

@@ -6,3 +6,3 @@ 'use strict'

var normalize = require('mdurl/encode')
var failsafe = require('../failsafe')
var revert = require('../revert')
var all = require('../all')

@@ -13,9 +13,15 @@

var def = h.definition(node.identifier)
var props = {href: normalize((def && def.url) || '')}
var props
if (def && def.title !== null && def.title !== undefined) {
if (!def) {
return revert(h, node)
}
props = {href: normalize(def.url || '')}
if (def.title !== null && def.title !== undefined) {
props.title = def.title
}
return failsafe(h, node, def) || h(node, 'a', props, all(h, node))
return h(node, 'a', props, all(h, node))
}
{
"name": "mdast-util-to-hast",
"version": "3.0.1",
"version": "3.0.2",
"description": "Transform MDAST to HAST",

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

"browserify": "^16.0.0",
"esmangle": "^1.0.1",
"nyc": "^12.0.0",

@@ -43,2 +42,3 @@ "prettier": "^1.13.3",

"tape": "^4.0.0",
"tinyify": "^2.4.3",
"xo": "^0.21.0"

@@ -48,4 +48,4 @@ },

"format": "remark . -qfo && prettier --write '**/*.js' && xo --fix",
"build-bundle": "browserify index.js --bare -s mdastUtilToHAST > mdast-util-to-hast.js",
"build-mangle": "esmangle mdast-util-to-hast.js > mdast-util-to-hast.min.js",
"build-bundle": "browserify index.js -s mdastUtilToHAST > mdast-util-to-hast.js",
"build-mangle": "browserify index.js -s mdastUtilToHAST -p tinyify > mdast-util-to-hast.min.js",
"build": "npm run build-bundle && npm run build-mangle",

@@ -52,0 +52,0 @@ "test-api": "node test",

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