Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork0
Ignore content display via HTML comments, Shown in GitHub readme, excluded in HTML.
License
NotificationsYou must be signed in to change notification settings
jaywcjlove/rehype-ignore
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Ignore content display via HTML comments, Shown in GitHub readme, excluded in HTML.
This package isESM only: Node 12+ is needed to use it and it must beimport instead ofrequire.
npm install rehype-ignore
exportdeclaretypeRehypeIgnoreOptions={/** * Character to use for opening delimiter, by default `rehype:ignore:start` */openDelimiter?:string;/** * Character to use for closing delimiter, by default `rehype:ignore:end` */closeDelimiter?:string;};
import{rehype}from'rehype';importrehypeIgnorefrom'rehype-ignore';rehype().data('settings',{fragment:true}).use(rehypeIgnore,{})
<h1>header</h1><p> Hello<!--rehype:ignore:start--><code>World</code><!--rehype:ignore:end--></p>
Output:
<h1>header</h1><p> Hello</p>
import{rehype}from'rehype';importrehypeIgnorefrom'rehype-ignore';consthtml=`<h1>header</h1><p> Hello <!--rehype:ignore:start--> <code>World</code> <!--rehype:ignore:end--></p>`consthtmlStr=rehype().data('settings',{fragment:true}).use(rehypeAttrs,{properties:'attr'}).processSync(html).toString()
#Hello World<!--rehype:ignore:start-->Hello World<!--rehype:ignore:end-->Good!
Output:
<h1>Hello World</h1><p>Good!</p>
import{unified}from'unified';importrehypeIgnorefrom'rehype-ignore';importremarkParsefrom'remark-parse';importremark2rehypefrom'remark-rehype';importrehypeRawfrom'rehype-raw';importstringifyfrom'rehype-stringify';consthtml=`# Hello World<!--rehype:ignore:start-->Hello World<!--rehype:ignore:end-->Good!`consthtmlStr=unified().use(remarkParse).use(remark2rehype,{allowDangerousHtml:true}).use(rehypeRaw).use(rehypeIgnore,{}).use(stringify).processSync(html).toString()
rehype-rewriteRewrite element with rehype.rehype-videoAdd improved video syntax: links to.mp4and.movturn into videos.rehype-attrNew syntax to add attributes to Markdown.rehype-ignoreIgnore content display via HTML comments, Shown in GitHub readme, excluded in HTML.remark-github-blockquote-alertRemark plugin to add support for GitHub Alert.
As always, thanks to our amazing contributors!
Made withaction-contributors.
MIT ©Kenny Wong
About
Ignore content display via HTML comments, Shown in GitHub readme, excluded in HTML.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.