Ignore content display via HTML comments, Shown in GitHub readme, excluded in HTML.
npm install rehype-ignorerehype-ignore
===






Ignore content display via HTML comments, Shown in GitHub readme, excluded in HTML.
This package is ESM only: Node 12+ is needed to use it and it must be import instead of require.
``bash`
npm install rehype-ignore
`tsrehype:ignore:start
export declare type RehypeIgnoreOptions = {
/**
* Character to use for opening delimiter, by default rehype:ignore:end
*/
openDelimiter?: string;
/**
* Character to use for closing delimiter, by default `
*/
closeDelimiter?: string;
};
`js
import { rehype } from 'rehype';
import rehypeIgnore from 'rehype-ignore';
rehype()
.data('settings', { fragment: true })
.use(rehypeIgnore, { })
`
`html`header
Hello World
Output:
`html`header
Hello
`js
import { rehype } from 'rehype';
import rehypeIgnore from 'rehype-ignore';
const html =
Hello World
const htmlStr = rehype()
.data('settings', { fragment: true })
.use(rehypeAttrs, { properties: 'attr' })
.processSync(html)
.toString()
`$3
`markdown
Hello World
Hello World
Good!
`Output:
`html
Hello World
Good!
``js
import { unified } from 'unified';
import rehypeIgnore from 'rehype-ignore';
import remarkParse from 'remark-parse';
import remark2rehype from 'remark-rehype';
import rehypeRaw from 'rehype-raw';
import stringify from 'rehype-stringify';const html =
# Hello WorldHello World
Good!
const htmlStr = unified()
.use(remarkParse)
.use(remark2rehype, { allowDangerousHtml: true })
.use(rehypeRaw)
.use(rehypeIgnore, { })
.use(stringify)
.processSync(html)
.toString()
`
- rehype-rewrite Rewrite element with rehype.
- rehype-video Add improved video syntax: links to .mp4 and .mov turn into videos.rehype-attr
- New syntax to add attributes to Markdown.rehype-ignore
- Ignore content display via HTML comments, Shown in GitHub readme, excluded in HTML.remark-github-blockquote-alert` Remark plugin to add support for GitHub Alert.
-
As always, thanks to our amazing contributors!
Made with action-contributors.
MIT © Kenny Wong