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

rehype-ignore

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rehype-ignore - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

1

lib/index.js

@@ -17,3 +17,2 @@ import { visit } from 'unist-util-visit';

str = str.replace(/^<!--(.*?)-->/, '$1');
console.log('str::', item.type, str);
if (str === openDelimiter) {

@@ -20,0 +19,0 @@ start = true;

2

package.json
{
"name": "rehype-ignore",
"version": "1.0.2",
"version": "1.0.3",
"description": "Ignore content display via HTML comments, Shown in GitHub readme, excluded in HTML.",

@@ -5,0 +5,0 @@ "homepage": "https://jaywcjlove.github.io/rehype-ignore",

@@ -9,2 +9,14 @@ import { unified } from 'unified';

it('rehypeIgnore markdown raw test case 1', async () => {
const markdown = `<!--rehype:ignore:start-->\n# Title\n<!--rehype:ignore:end-->\n\ntest`;
const htmlStr = unified()
.use(remarkParse)
.use(remark2rehype, { allowDangerousHtml: true })
.use(rehypeIgnore, { })
.use(stringify)
.processSync(markdown)
.toString()
expect(htmlStr).toEqual('\n<p>test</p>');
});
it('rehypeIgnore test case 1', async () => {

@@ -11,0 +23,0 @@ const html = `<!--rehype:ignore:start--><h1>header</h1><!--rehype:ignore:end-->`;

@@ -31,3 +31,2 @@ import { Plugin } from 'unified';

str = str.replace(/^<!--(.*?)-->/, '$1')
console.log('str::', item.type, str)
if (str === openDelimiter) {

@@ -34,0 +33,0 @@ start = true;

Sorry, the diff of this file is not supported yet

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