Project: micromark/micromark-extension-gfm-autolink-literal

Package: micromark-extension-gfm-autolink-literal@1.0.0

  1. Dependents: 4
  2. micromark extension to support GFM autolink literals
  1. unified 174
  2. markdown 131
  3. micromark 32
  4. gfm 18
  5. micromark-extension 15
  6. link 15
  7. url 13
  8. autolink 5
  9. literal 4
  10. auto 4


Build Coverage Downloads Size Sponsors Backers Chat

micromark extension to support GitHub flavored markdown (GFM) literal autolinks.

This syntax extension matches the GFM spec and how literal autolinks work in several places on github.com. GitHub employs two algorithms to autolink: one at parse time and one at transform time (similar to how @mentions are done at transform time). This difference can be observed because character references and escapes are handled differently. But also because issues/PRs/comments omit (perhaps by accident?) the second algorithm for www., http://, and https:// links (but not for email links).

As this is a syntax extension, it focuses on the first algorithm. The html part of this extension does not operate on an AST and hence can’t perform the second algorithm. mdast-util-gfm-autolink-literal adds support for the second.

When to use this

You should probably use micromark-extension-gfm, which combines this package with other GFM features, instead. Alternatively, if you don’t want all of GFM, use this package.


This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required.


npm install micromark-extension-gfm-autolink-literal


import {micromark} from 'micromark'
import {
} from 'micromark-extension-gfm-autolink-literal'

const output = micromark('Just a URL: www.example.com.', {
  extensions: [gfmAutolinkLiteral],
  htmlExtensions: [gfmAutolinkLiteralHtml]



<p>Just a URL: <a href="http://www.example.com">www.example.com</a>.</p>


This package exports the following identifiers: gfmAutolinkLiteral, gfmAutolinkLiteralHtml. There is no default export.

The export map supports the endorsed development condition. Run node --conditions development module.js to get instrumented dev code. Without this condition, production code is loaded.



An extension for the micromark parser (to parse; can be passed in extensions) and one for the HTML compiler (to compile as <a> elements; can be passed in htmlExtensions).


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.


MIT © Titus Wormer