You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

micromark-extension-mdx-md

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

micromark-extension-mdx-md

micromark extension to turn some markdown features off for MDX


Version published
Weekly downloads
1.5M
increased by2%
Maintainers
1
Install size
45.1 kB
Created
Weekly downloads
 

Readme

Source

micromark-extension-mdx-md

Build Coverage Downloads Size Sponsors Backers Chat

micromark extension to turn some markdown features off for MDX.

Contents

What is this?

This package contains an extension to turn off some markdown constructs when parsing.

When to use this

This project is useful when you want to disable support for code (indented), autolinks, and HTML (flow and text) in markdown.

You can use this extension when you are working with micromark. To support all MDX features, use micromark-extension-mdxjs instead.

All these packages are used in remark-mdx, which focusses on making it easier to transform content by abstracting these internals away.

Install

This package is ESM only. In Node.js (version 16+), install with npm:

npm install micromark-extension-mdx-md

In Deno with esm.sh:

import {mdxMd} from 'https://esm.sh/micromark-extension-mdx-md@1'

In browsers with esm.sh:

<script type="module">
  import {mdxMd} from 'https://esm.sh/micromark-extension-mdx-md@1?bundle'
</script>

Use

import {micromark} from 'micromark'
import {mdxMd} from 'micromark-extension-mdx-md'

const output = micromark('\ta', {extensions: [mdxMd]})

console.log(output)

Yields:

<p>a</p>

API

This package exports the identifier mdxMd. There is no default export.

mdxMd

Extension for micromark that can be passed in extensions to disable some CommonMark syntax (code (indented), autolinks, and HTML (flow and text)) for MDX (Extension).

Authoring

To improve authoring the new constructs MDX adds (JSX, expressions, and ESM), some markdown features are turned off by this extension. There are good alternatives.

Code (indented)

Use fenced code instead. Change the following markdown:

    console.log(1)

…into:

```js
console.log(1)
```

Use links (with a resource or a reference) instead. Change the following markdown:

<https://some-link-here.com>

…into:

[descriptive text](https://and-the-link-here.com)
HTML (flow and text)

Use JSX instead: change <img> into <img />. Not supporting HTML also means that HTML comments are not supported. Use a comment in an empty expression instead. Change <!-- comment --> into {/* comment */}.

Types

This package is fully typed with TypeScript. It exports no additional types.

Compatibility

Projects maintained by the unified collective are compatible with all maintained versions of Node.js. As of now, that is Node.js 16+. Our projects sometimes work with older versions, but this is not guaranteed.

These extensions work with micromark version 3+.

Security

This package is safe.

Contribute

See contributing.md in micromark/.github for ways to get started. See support.md for ways to get help.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.

License

MIT © Titus Wormer

Keywords

FAQs

Package last updated on 10 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc