8
8
* @typedef {import('mdast-util-to-markdown').Handle } ToMarkdownHandle
9
9
* @typedef {import('mdast-util-to-markdown').Map } ToMarkdownMap
10
10
* @typedef {import('estree-jsx').Program } Program
11
- * @typedef {import('./complex-types').MDXJsxAttributeValueExpression } MDXJsxAttributeValueExpression
12
- * @typedef {import('./complex-types').MDXJsxAttribute } MDXJsxAttribute
13
- * @typedef {import('./complex-types').MDXJsxExpressionAttribute } MDXJsxExpressionAttribute
14
- * @typedef {import('./complex-types').MDXJsxFlowElement } MDXJsxFlowElement
15
- * @typedef {import('./complex-types').MDXJsxTextElement } MDXJsxTextElement
16
- * @typedef {{name: string|null, attributes: (MDXJsxAttribute|MDXJsxExpressionAttribute)[], close?: boolean, selfClosing?: boolean, start: Token['start'], end: Token['start']} } Tag
11
+ * @typedef {import('./complex-types').MdxJsxAttributeValueExpression } MdxJsxAttributeValueExpression
12
+ * @typedef {import('./complex-types').MdxJsxAttribute } MdxJsxAttribute
13
+ * @typedef {import('./complex-types').MdxJsxExpressionAttribute } MdxJsxExpressionAttribute
14
+ * @typedef {import('./complex-types').MdxJsxFlowElement } MdxJsxFlowElement
15
+ * @typedef {import('./complex-types').MdxJsxTextElement } MdxJsxTextElement
16
+ * @typedef {{name: string|null, attributes: (MdxJsxAttribute|MdxJsxExpressionAttribute)[], close?: boolean, selfClosing?: boolean, start: Token['start'], end: Token['start']} } Tag
17
+ */
18
+
19
+ /**
20
+ * Legacy names:
21
+ *
22
+ * @typedef {MdxJsxAttributeValueExpression } MDXJsxAttributeValueExpression
23
+ * @typedef {MdxJsxAttribute } MDXJsxAttribute
24
+ * @typedef {MdxJsxExpressionAttribute } MDXJsxExpressionAttribute
25
+ * @typedef {MdxJsxFlowElement } MDXJsxFlowElement
26
+ * @typedef {MdxJsxTextElement } MDXJsxTextElement
17
27
*/
18
28
19
29
import { parseEntities } from 'parse-entities'
@@ -197,7 +207,7 @@ function enterMdxJsxTagExpressionAttribute(token) {
197
207
/** @type {FromMarkdownHandle } */
198
208
function exitMdxJsxTagExpressionAttribute ( token ) {
199
209
const tag = /** @type {Tag } */ ( this . getData ( 'mdxJsxTag' ) )
200
- const tail = /** @type {MDXJsxExpressionAttribute } */ (
210
+ const tail = /** @type {MdxJsxExpressionAttribute } */ (
201
211
tag . attributes [ tag . attributes . length - 1 ]
202
212
)
203
213
/** @type {Program|undefined } */
@@ -214,7 +224,7 @@ function exitMdxJsxTagExpressionAttribute(token) {
214
224
/** @type {FromMarkdownHandle } */
215
225
function exitMdxJsxTagAttributeNamePrimary ( token ) {
216
226
const tag = /** @type {Tag } */ ( this . getData ( 'mdxJsxTag' ) )
217
- const node = /** @type {MDXJsxAttribute } */ (
227
+ const node = /** @type {MdxJsxAttribute } */ (
218
228
tag . attributes [ tag . attributes . length - 1 ]
219
229
)
220
230
node . name = this . sliceSerialize ( token )
@@ -223,7 +233,7 @@ function exitMdxJsxTagAttributeNamePrimary(token) {
223
233
/** @type {FromMarkdownHandle } */
224
234
function exitMdxJsxTagAttributeNameLocal ( token ) {
225
235
const tag = /** @type {Tag } */ ( this . getData ( 'mdxJsxTag' ) )
226
- const node = /** @type {MDXJsxAttribute } */ (
236
+ const node = /** @type {MdxJsxAttribute } */ (
227
237
tag . attributes [ tag . attributes . length - 1 ]
228
238
)
229
239
node . name += ':' + this . sliceSerialize ( token )
@@ -241,10 +251,10 @@ function exitMdxJsxTagAttributeValueLiteral() {
241
251
/** @type {FromMarkdownHandle } */
242
252
function exitMdxJsxTagAttributeValueExpression ( token ) {
243
253
const tag = /** @type {Tag } */ ( this . getData ( 'mdxJsxTag' ) )
244
- const tail = /** @type {MDXJsxAttribute } */ (
254
+ const tail = /** @type {MdxJsxAttribute } */ (
245
255
tag . attributes [ tag . attributes . length - 1 ]
246
256
)
247
- /** @type {MDXJsxAttributeValueExpression } */
257
+ /** @type {MdxJsxAttributeValueExpression } */
248
258
const node = { type : 'mdxJsxAttributeValueExpression' , value : this . resume ( ) }
249
259
/** @type {Program|undefined } */
250
260
// @ts -expect-error: custom.
@@ -324,7 +334,7 @@ function serializeAbbreviatedTag(tag) {
324
334
325
335
/**
326
336
* @type {ToMarkdownHandle }
327
- * @param {MDXJsxFlowElement|MDXJsxTextElement } node
337
+ * @param {MdxJsxFlowElement|MdxJsxTextElement } node
328
338
*/
329
339
// eslint-disable-next-line complexity
330
340
function mdxElement ( node , _ , context ) {
0 commit comments