From 2e89b933ef700bc7edca02dfb0b780b60513d00f Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Thu, 1 Feb 2024 11:24:05 +0100 Subject: [PATCH] Add support for directives, math, MDX --- lib/index.js | 10 +++++++++- test.js | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index 4b90acb..64f0769 100644 --- a/lib/index.js +++ b/lib/index.js @@ -29,9 +29,17 @@ export const phrasing = 'image', 'imageReference', 'inlineCode', + // Enabled by `mdast-util-math`: + 'inlineMath', 'link', 'linkReference', + // Enabled by `mdast-util-mdx`: + 'mdxJsxTextElement', + // Enabled by `mdast-util-mdx`: + 'mdxTextExpression', 'strong', - 'text' + 'text', + // Enabled by `mdast-util-directive`: + 'textDirective' ]) ) diff --git a/test.js b/test.js index 9fe4508..88c0b9a 100644 --- a/test.js +++ b/test.js @@ -51,4 +51,8 @@ test('phrasing', async function (t) { assert.equal(phrasing({type: 'list'}), false) } ) + + await t.test('should support common extensions', async function () { + assert.equal(phrasing({type: 'textDirective'}), true) + }) })