Skip to content

Commit

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

- [Example Heading (With Parenthetic Comment)](#example-heading-with-parenthetic-comment)
- [path/to/file.txt](#pathtofiletxt)

<!-- tocstop -->

## Example Heading (With Parenthetic Comment)

Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat.

## path/to/file.txt

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

## Example Heading (With Parenthetic Comment)

Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat.

## path/to/file.txt

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

it('should strip symbols instead of making them dashes in slug', function() {
assert.equal(toc.insert(read('test/fixtures/symbols-in-heading.md')), read('test/expected/symbols-in-heading.md'))
})

});

0 comments on commit a800ab7

Please sign in to comment.