Skip to content

Commit

Permalink
test: add test case.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Apr 15, 2022
1 parent 8538f5d commit 2f1faef
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/__test__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,19 @@ Good!`;
expect(htmlStr).toEqual(expected);
});

it('rehypeIgnore test case openDelimiter/closeDelimiter', async () => {
const html = `<!--idoc:start--><h1>header</h1><!--idoc:end-->`;
const htmlStr = rehype()
.data('settings', { fragment: true })
.use(rehypeIgnore, {
openDelimiter: 'idoc:start',
closeDelimiter: 'idoc:end',
})
.use(stringify)
.processSync(html)
.toString()
expect(htmlStr).toEqual('');
});

it('rehypeIgnore test case', async () => {
const html = `<!--rehype:ignore:start-->
Expand Down

0 comments on commit 2f1faef

Please sign in to comment.