Skip to content

Commit 9b9d2c9

Browse files
committed
update test
1 parent a0b11b5 commit 9b9d2c9

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

test/unit/render.test.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,41 @@ describe('render', function() {
251251
</h6>`
252252
);
253253
});
254+
255+
it('ignore', async function() {
256+
const { docsify } = await init();
257+
const output = docsify.compiler.compile('## h2 tag {docsify-ignore}');
258+
expectSameDom(
259+
output,
260+
`
261+
<h2 id="h2-tag">
262+
<a href="#/?id=h2-tag" data-id="h2-tag" class="anchor">
263+
<span>h2 tag </span>
264+
</a>
265+
</h2>`
266+
);
267+
});
268+
269+
it('ignore-all', async function() {
270+
const { docsify } = await init();
271+
const output = docsify.compiler.compile(
272+
`# h1 tag {docsify-ignore-all}` + `\n## h2 tag`
273+
);
274+
expectSameDom(
275+
output,
276+
`
277+
<h1 id="h1-tag">
278+
<a href="#/?id=h1-tag" data-id="h1-tag" class="anchor">
279+
<span>h1 tag </span>
280+
</a>
281+
</h1>
282+
<h2 id="h2-tag">
283+
<a href="#/?id=h2-tag" data-id="h2-tag" class="anchor">
284+
<span>h2 tag</span>
285+
</a>
286+
</h2>`
287+
);
288+
});
254289
});
255290

256291
describe('link', function() {

0 commit comments

Comments
 (0)