mdast-util-mdx-expression
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "mdast-util-mdx-expression", | ||
"version": "0.1.0", | ||
"description": "mdast extension to parse and serialize MDX or MDX.js expressions", | ||
"version": "0.1.1", | ||
"description": "mdast extension to parse and serialize MDX (or MDX.js) expressions", | ||
"license": "MIT", | ||
@@ -48,3 +48,3 @@ "keywords": [ | ||
"unist-util-remove-position": "^3.0.0", | ||
"xo": "^0.35.0" | ||
"xo": "^0.36.0" | ||
}, | ||
@@ -51,0 +51,0 @@ "scripts": { |
@@ -12,4 +12,3 @@ # mdast-util-mdx-expression | ||
Extension for [`mdast-util-from-markdown`][from-markdown] and/or | ||
[`mdast-util-to-markdown`][to-markdown] to support expressions for MDX or MDX.js | ||
in **[mdast][]**. | ||
[`mdast-util-to-markdown`][to-markdown] to support MDX (or MDX.js) expressions. | ||
When parsing (`from-markdown`), must be combined with | ||
@@ -21,5 +20,5 @@ [`micromark-extension-mdx-expression`][extension]. | ||
You probably should use either `micromark-extension-mdx` with `mdast-util-mdx` | ||
or `micromark-extension-mdxjs` with `mdast-util-mdxjs` (which both include this | ||
package) to support all of MDX or MDX.js. | ||
You probably should use either [`micromark-extension-mdx`][mdx] or | ||
[`micromark-extension-mdxjs`][mdxjs] with [`mdast-util-mdx`][mdast-util-mdx] | ||
(which both include this package) to support all of MDX (or MDX.js). | ||
Or use it all through `remark-mdx` or `remark-mdxjs` (**[remark][]**). | ||
@@ -125,3 +124,3 @@ | ||
Support expressions in MDX or MDX.js. | ||
Support MDX (or MDX.js) expressions. | ||
The exports are extensions, respectively for | ||
@@ -152,4 +151,3 @@ [`mdast-util-from-markdown`][from-markdown] and | ||
expression embedded in flow (block). | ||
It can be used where **[flow expression][dfn-flow-expression-content]** content | ||
is expected. | ||
It can be used where **[flow][dfn-flow-content]** content is expected. | ||
Its content is represented by its `value` field. | ||
@@ -181,4 +179,3 @@ | ||
expression embedded in text (span, inline). | ||
It can be used where **[phrasing expression][dfn-phrasing-expression-content]** | ||
content is expected. | ||
It can be used where **[phrasing][dfn-phrasing-content]** content is expected. | ||
Its content is represented by its `value` field. | ||
@@ -200,30 +197,14 @@ | ||
#### `FlowExpressionContent` | ||
#### `FlowContent` (MDX expression) | ||
```idl | ||
type FlowExpressionContent = MDXFlowExpression | ||
type FlowContentMdxExpression = MDXFlowExpression | FlowContent | ||
``` | ||
**FlowExpression** content represent an embedded JavaScript expression. | ||
#### `PhrasingExpressionContent` | ||
```idl | ||
type PhrasingExpressionContent = MDXTextExpression | ||
``` | ||
**PhrasingExpression** content represent an embedded JavaScript expression. | ||
#### `PhrasingContent` (MDX expression) | ||
```idl | ||
type PhrasingContentMdxExpression = PhrasingExpressionContent | PhrasingContent | ||
type PhrasingContentMdxExpression = MDXTextExpression | PhrasingContent | ||
``` | ||
#### `FlowContent` (MDX expression) | ||
```idl | ||
type FlowContentMdxExpression = FlowExpressionContent | FlowContent | ||
``` | ||
## Related | ||
@@ -241,10 +222,8 @@ | ||
— mdast serializer to create markdown from mdast | ||
* `syntax-tree/mdast-util-mdx` | ||
— mdast utility to support all of MDX | ||
* `syntax-tree/mdast-util-mdxjs` | ||
— mdast utility to support all of MDX.js | ||
* [`syntax-tree/mdast-util-mdx`][mdast-util-mdx] | ||
— mdast utility to support MDX | ||
* [`micromark/micromark`][micromark] | ||
— the smallest commonmark-compliant markdown parser that exists | ||
* [`micromark/micromark-extension-mdx-expression`][extension] | ||
— micromark extension to parse expressions | ||
— micromark extension to parse MDX expressions | ||
@@ -317,2 +296,8 @@ ## Contribute | ||
[mdx]: https://github.com/micromark/micromark-extension-mdx | ||
[mdxjs]: https://github.com/micromark/micromark-extension-mdxjs | ||
[mdast-util-mdx]: https://github.com/syntax-tree/mdast-util-mdx | ||
[estree]: https://github.com/estree/estree | ||
@@ -322,4 +307,4 @@ | ||
[dfn-flow-expression-content]: #flowexpressioncontent | ||
[dfn-flow-content]: #flowcontent-mdx-expression | ||
[dfn-phrasing-expression-content]: #phrasingexpressioncontent | ||
[dfn-phrasing-content]: #phrasingcontent-mdx-expression |
@@ -6,2 +6,7 @@ exports.handlers = { | ||
exports.unsafe = [ | ||
{character: '{', inConstruct: ['phrasing']}, | ||
{atBreak: true, character: '{'} | ||
] | ||
var eol = /\r?\n|\r/g | ||
@@ -8,0 +13,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
73
12684
302