rehype-ignore
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -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; |
{ | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14869
203