diff --git a/dev/lib/math-flow.js b/dev/lib/math-flow.js index 8f0d6a0..d795fab 100644 --- a/dev/lib/math-flow.js +++ b/dev/lib/math-flow.js @@ -10,7 +10,8 @@ import {codes, constants, types} from 'micromark-util-symbol' /** @type {Construct} */ export const mathFlow = { tokenize: tokenizeMathFenced, - concrete: true + concrete: true, + name: 'mathFlow' } /** @type {Construct} */ diff --git a/dev/lib/math-text.js b/dev/lib/math-text.js index 89bc08b..808814f 100644 --- a/dev/lib/math-text.js +++ b/dev/lib/math-text.js @@ -27,7 +27,8 @@ export function mathText(options) { return { tokenize: tokenizeMathText, resolve: resolveMathText, - previous + previous, + name: 'mathText' } /** diff --git a/test/index.js b/test/index.js index 9a5cc7f..edaf338 100644 --- a/test/index.js +++ b/test/index.js @@ -14,6 +14,19 @@ test('math', async function (t) { ) }) + await t.test( + 'should skip `mathFlow` and `mathText` construct if `disable.null` includes `mathFlow` and `mathText`', + async function () { + assert.equal( + micromark('$a$, $$b$$, $$$c$$$', { + extensions: [math(), {disable: {null: ['mathFlow', 'mathText']}}], + htmlExtensions: [mathHtml()] + }), + '

$a$, $$b$$, $$$c$$$

' + ) + } + ) + await t.test( 'should support one, two, or more dollars by default', async function () {