diff --git a/lib/markdown-it/deflist.js b/lib/markdown-it/deflist.js index 8040ec39..7762af3b 100644 --- a/lib/markdown-it/deflist.js +++ b/lib/markdown-it/deflist.js @@ -1,5 +1,5 @@ /** - * Definition list + * Render a definition list * * @param {Function} md - markdown-it instance * @returns {Function} - markdown-it rendering rules diff --git a/lib/markdown-it/footnote.js b/lib/markdown-it/footnote.js index ba3525ed..e0c50e19 100644 --- a/lib/markdown-it/footnote.js +++ b/lib/markdown-it/footnote.js @@ -1,5 +1,5 @@ /** - * Footnotes + * Render footnotes * * @param {Function} md - markdown-it instance * @returns {Function} - markdown-it rendering rules diff --git a/lib/markdown-it/table-of-contents.js b/lib/markdown-it/table-of-contents.js index 816d93dd..bea30a6a 100644 --- a/lib/markdown-it/table-of-contents.js +++ b/lib/markdown-it/table-of-contents.js @@ -1,5 +1,5 @@ /** - * Table of contents + * Render a table of contents * * @param {Function} md - markdown-it instance * @returns {Function} - markdown-it rendering rules diff --git a/lib/markdown-it/table.js b/lib/markdown-it/table.js index 3ce0fe82..f80ba5b4 100644 --- a/lib/markdown-it/table.js +++ b/lib/markdown-it/table.js @@ -1,7 +1,5 @@ /** - * Responsive tables - * - * Add `tabindex` so that table scrolling can be controlled via the keyboard. + * Render a table with `tabindex` to enable keyboard scrolling * * @param {Function} md - markdown-it instance * @returns {Function} - markdown-it rendering rules diff --git a/test/lib/markdown-it.mjs b/test/lib/markdown-it.mjs new file mode 100644 index 00000000..35346887 --- /dev/null +++ b/test/lib/markdown-it.mjs @@ -0,0 +1,56 @@ +import { strict as assert } from 'node:assert' +import { describe, it } from 'node:test' +import md from '../../lib/markdown-it.js' + +describe('markdown-it', () => { + it('Returns configured markdown-it parser', () => { + const { options } = md() + + assert.equal(options.breaks, true) + assert.equal(typeof options.highlight, 'function') + assert.equal(options.html, true) + assert.equal(options.linkify, false) + assert.equal(options.typographer, true) + }) + + it('Renders anchor heading permalinks when option enabled', () => { + const result = md({ + headingPermalinks: true + }).render('# Heading') + + assert.equal(result, '