9
9
[ ![ Chat] [ chat-badge ]] [ chat ]
10
10
11
11
Extension for [ ` mdast-util-from-markdown ` ] [ from-markdown ] and/or
12
- [ ` mdast-util-to-markdown ` ] [ to-markdown ] to support expressions for MDX or MDX.js
13
- in ** [ mdast] [ ] ** .
12
+ [ ` mdast-util-to-markdown ` ] [ to-markdown ] to support MDX (or MDX.js) expressions.
14
13
When parsing (` from-markdown ` ), must be combined with
15
14
[ ` micromark-extension-mdx-expression ` ] [ extension ] .
16
15
@@ -120,7 +119,7 @@ b {true}.
120
119
> ` mdast-util-mdx-expression/from-markdown ` and
121
120
> ` mdast-util-mdx-expression/to-markdown ` .
122
121
123
- Support expressions in MDX or MDX.js.
122
+ Support MDX ( or MDX.js) expressions .
124
123
The exports are extensions, respectively for
125
124
[ ` mdast-util-from-markdown ` ] [ from-markdown ] and
126
125
[ ` mdast-util-to-markdown ` ] [ to-markdown ] .
@@ -146,8 +145,7 @@ interface MDXFlowExpression <: Literal {
146
145
147
146
** MDXFlowExpression** (** [ Literal] [ dfn-literal ] ** ) represents a JavaScript
148
147
expression embedded in flow (block).
149
- It can be used where ** [ flow expression] [ dfn-flow-expression-content ] ** content
150
- is expected.
148
+ It can be used where ** [ flow] [ dfn-flow-content ] ** content is expected.
151
149
Its content is represented by its ` value ` field.
152
150
153
151
For example, the following markdown:
@@ -174,8 +172,7 @@ interface MDXTextExpression <: Literal {
174
172
175
173
** MDXTextExpression** (** [ Literal] [ dfn-literal ] ** ) represents a JavaScript
176
174
expression embedded in text (span, inline).
177
- It can be used where ** [ phrasing expression] [ dfn-phrasing-expression-content ] **
178
- content is expected.
175
+ It can be used where ** [ phrasing] [ dfn-phrasing-content ] ** content is expected.
179
176
Its content is represented by its ` value ` field.
180
177
181
178
For example, the following markdown:
@@ -192,32 +189,16 @@ Yields:
192
189
193
190
### Content model
194
191
195
- #### ` FlowExpressionContent `
196
-
197
- ``` idl
198
- type FlowExpressionContent = MDXFlowExpression
199
- ```
200
-
201
- ** FlowExpression** content represent an embedded JavaScript expression.
202
-
203
- #### ` PhrasingExpressionContent `
192
+ #### ` FlowContent ` (MDX expression)
204
193
205
194
``` idl
206
- type PhrasingExpressionContent = MDXTextExpression
195
+ type FlowContentMdxExpression = MDXFlowExpression | FlowContent
207
196
```
208
197
209
- ** PhrasingExpression** content represent an embedded JavaScript expression.
210
-
211
198
#### ` PhrasingContent ` (MDX expression)
212
199
213
200
``` idl
214
- type PhrasingContentMdxExpression = PhrasingExpressionContent | PhrasingContent
215
- ```
216
-
217
- #### ` FlowContent ` (MDX expression)
218
-
219
- ``` idl
220
- type FlowContentMdxExpression = FlowExpressionContent | FlowContent
201
+ type PhrasingContentMdxExpression = MDXTextExpression | PhrasingContent
221
202
```
222
203
223
204
## Related
@@ -233,13 +214,13 @@ type FlowContentMdxExpression = FlowExpressionContent | FlowContent
233
214
* [ ` syntax-tree/mdast-util-to-markdown ` ] [ to-markdown ]
234
215
— mdast serializer to create markdown from mdast
235
216
* ` syntax-tree/mdast-util-mdx `
236
- — mdast utility to support all of MDX
217
+ — mdast utility to support MDX
237
218
* ` syntax-tree/mdast-util-mdxjs `
238
- — mdast utility to support all of MDX.js
219
+ — mdast utility to support MDX.js
239
220
* [ ` micromark/micromark ` ] [ micromark ]
240
221
— the smallest commonmark-compliant markdown parser that exists
241
222
* [ ` micromark/micromark-extension-mdx-expression ` ] [ extension ]
242
- — micromark extension to parse expressions
223
+ — micromark extension to parse MDX expressions
243
224
244
225
## Contribute
245
226
@@ -311,6 +292,6 @@ abide by its terms.
311
292
312
293
[ dfn-literal ] : https://github.com/syntax-tree/mdast#literal
313
294
314
- [ dfn-flow-expression- content ] : #flowexpressioncontent
295
+ [ dfn-flow-content ] : #flowcontent-mdx-expression
315
296
316
- [ dfn-phrasing-expression- content ] : #phrasingexpressioncontent
297
+ [ dfn-phrasing-content ] : #phrasingcontent-mdx-expression
0 commit comments