From 2354da5584a1c72ebf3cb21bba6c1a6e1215304e Mon Sep 17 00:00:00 2001 From: Roland <45024986+shlroland@users.noreply.github.com> Date: Fri, 5 Jul 2024 17:25:57 +0800 Subject: [PATCH] Add `name` Closes GH-4. Reviewed-by: Titus Wormer --- dev/lib/syntax.js | 1 + test/index.js | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/dev/lib/syntax.js b/dev/lib/syntax.js index 1e61d41..9496b0b 100644 --- a/dev/lib/syntax.js +++ b/dev/lib/syntax.js @@ -35,6 +35,7 @@ export function gfmStrikethrough(options) { const options_ = options || {} let single = options_.singleTilde const tokenizer = { + name: 'strikethrough', tokenize: tokenizeStrikethrough, resolveAll: resolveAllStrikethrough } diff --git a/test/index.js b/test/index.js index 231103f..00f4f92 100644 --- a/test/index.js +++ b/test/index.js @@ -138,6 +138,19 @@ test('micromark-extension-gfm-strikethrough', async function (t) { ) }) +await test.test( + 'should skip strikethrough construct if `disable.null` includes `strikethrough`', + async function () { + assert.deepEqual( + micromark('a ~~b~~', { + extensions: [gfmStrikethrough(), {disable: {null: ['strikethrough']}}], + htmlExtensions: [gfmStrikethroughHtml()] + }), + '

a ~~b~~

' + ) + } +) + test('fixtures', async function (t) { const base = new URL('fixtures/', import.meta.url)