From 57970fc14e211e6409b6570a141f3ff537a5a92c Mon Sep 17 00:00:00 2001 From: Gregory Danielson Date: Tue, 19 Sep 2023 10:50:47 -0500 Subject: [PATCH] chore: Add test for inline code in header (closes #170; already fixed) --- test/expected/inline-code.md | 9 +++++++++ test/fixtures/inline-code.md | 5 +++++ test/test.js | 5 +++++ 3 files changed, 19 insertions(+) create mode 100644 test/expected/inline-code.md create mode 100644 test/fixtures/inline-code.md diff --git a/test/expected/inline-code.md b/test/expected/inline-code.md new file mode 100644 index 0000000..3f6380f --- /dev/null +++ b/test/expected/inline-code.md @@ -0,0 +1,9 @@ + + +- [The `log-in` element](#the-log-in-element) + + + +## The `log-in` element + +Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat. \ No newline at end of file diff --git a/test/fixtures/inline-code.md b/test/fixtures/inline-code.md new file mode 100644 index 0000000..e904922 --- /dev/null +++ b/test/fixtures/inline-code.md @@ -0,0 +1,5 @@ + + +## The `log-in` element + +Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat. \ No newline at end of file diff --git a/test/test.js b/test/test.js index f29e77f..7e6f7c0 100644 --- a/test/test.js +++ b/test/test.js @@ -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')) + }) + });