99[ ![ Chat] [ chat-badge ]] [ chat ]
1010
1111Extension 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.
1413When parsing (` from-markdown ` ), must be combined with
1514[ ` micromark-extension-mdx-expression ` ] [ extension ] .
1615
@@ -120,7 +119,7 @@ b {true}.
120119> ` mdast-util-mdx-expression/from-markdown ` and
121120> ` mdast-util-mdx-expression/to-markdown ` .
122121
123- Support expressions in MDX or MDX.js.
122+ Support MDX ( or MDX.js) expressions .
124123The exports are extensions, respectively for
125124[ ` mdast-util-from-markdown ` ] [ from-markdown ] and
126125[ ` mdast-util-to-markdown ` ] [ to-markdown ] .
@@ -146,8 +145,7 @@ interface MDXFlowExpression <: Literal {
146145
147146** MDXFlowExpression** (** [ Literal] [ dfn-literal ] ** ) represents a JavaScript
148147expression 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.
151149Its content is represented by its ` value ` field.
152150
153151For example, the following markdown:
@@ -174,8 +172,7 @@ interface MDXTextExpression <: Literal {
174172
175173** MDXTextExpression** (** [ Literal] [ dfn-literal ] ** ) represents a JavaScript
176174expression 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.
179176Its content is represented by its ` value ` field.
180177
181178For example, the following markdown:
@@ -192,32 +189,16 @@ Yields:
192189
193190### Content model
194191
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)
204193
205194``` idl
206- type PhrasingExpressionContent = MDXTextExpression
195+ type FlowContentMdxExpression = MDXFlowExpression | FlowContent
207196```
208197
209- ** PhrasingExpression** content represent an embedded JavaScript expression.
210-
211198#### ` PhrasingContent ` (MDX expression)
212199
213200``` 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
221202```
222203
223204## Related
@@ -233,13 +214,13 @@ type FlowContentMdxExpression = FlowExpressionContent | FlowContent
233214* [ ` syntax-tree/mdast-util-to-markdown ` ] [ to-markdown ]
234215 — mdast serializer to create markdown from mdast
235216* ` syntax-tree/mdast-util-mdx `
236- — mdast utility to support all of MDX
217+ — mdast utility to support MDX
237218* ` syntax-tree/mdast-util-mdxjs `
238- — mdast utility to support all of MDX.js
219+ — mdast utility to support MDX.js
239220* [ ` micromark/micromark ` ] [ micromark ]
240221 — the smallest commonmark-compliant markdown parser that exists
241222* [ ` micromark/micromark-extension-mdx-expression ` ] [ extension ]
242- — micromark extension to parse expressions
223+ — micromark extension to parse MDX expressions
243224
244225## Contribute
245226
@@ -311,6 +292,6 @@ abide by its terms.
311292
312293[ dfn-literal ] : https://github.com/syntax-tree/mdast#literal
313294
314- [ dfn-flow-expression- content ] : #flowexpressioncontent
295+ [ dfn-flow-content ] : #flowcontent-mdx-expression
315296
316- [ dfn-phrasing-expression- content ] : #phrasingexpressioncontent
297+ [ dfn-phrasing-content ] : #phrasingcontent-mdx-expression
0 commit comments