Socket
Socket
Sign inDemoInstall

@hashicorp/remark-plugins

Package Overview
Dependencies
8
Maintainers
13
Versions
54
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.1 to 0.2.0

4

package.json
{
"name": "@hashicorp/remark-plugins",
"description": "A potpourri of remark plugins used to process .mdx files",
"version": "0.1.1",
"version": "0.2.0",
"author": "Kevin Pruett",

@@ -14,3 +14,3 @@ "bugs": "https://github.com/hashicorp/remark-plugins/issues",

"remark-slug": "^5.1.1",
"unist-util-is": "^2.1.3",
"unist-util-is": "^3.0.0",
"unist-util-visit": "^1.4.1"

@@ -17,0 +17,0 @@ },

@@ -11,3 +11,5 @@ const is = require('unist-util-is')

visit(liNode, 'paragraph', pNode => {
visit(pNode, 'inlineCode', codeNode => {
// Perform node reconstruction when code appears in first position
if (is(pNode.children[0], 'inlineCode')) {
const codeNode = pNode.children[0]
// Construct an id/slug based on value of <code> node

@@ -22,13 +24,9 @@ const codeSlug = slugger.slug(`inlinecode-${codeNode.value}`)

// Wrap link element around child <code> node
pNode.children = pNode.children.map(node => {
return is(node, codeNode)
? {
type: 'link',
url: `#${codeSlug}`,
title: null,
children: [node]
}
: node
})
})
pNode.children[0] = {
type: 'link',
url: `#${codeSlug}`,
title: null,
children: [pNode.children[0]]
}
}
})

@@ -35,0 +33,0 @@ })

@@ -22,3 +22,3 @@ const is = require('unist-util-is')

parent.children = parent.children.map(node => {
return is(node, pNode)
return is(pNode, node)
? {

@@ -25,0 +25,0 @@ type: 'wrapper',

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc