Skip to content

Commit

Permalink
chore: Add test for inline code in header (closes jonschlinkert#170; …
Browse files Browse the repository at this point in the history
…already fixed)
  • Loading branch information
gregdan3 committed Sep 19, 2023
1 parent 301a4d8 commit 57970fc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/expected/inline-code.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!-- toc -->

- [The `log-in` element](#the-log-in-element)

<!-- tocstop -->

## The `log-in` element

Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat.
5 changes: 5 additions & 0 deletions test/fixtures/inline-code.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- toc -->

## The `log-in` element

Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat.
5 changes: 5 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,4 +435,9 @@ describe('toc.insert', function() {
assert.equal(toc.insert(read('test/fixtures/commented-header.md')), read('test/expected/commented-header.md'));
})


it('should not strip inline code', function() {
assert.equal(toc.insert(read('test/fixtures/inline-code.md')), read('test/expected/inline-code.md'))
})

});

0 comments on commit 57970fc

Please sign in to comment.