Skip to main content
Version: 2.x.x


Npm VersionNpm DownloadNpm LicenseModule formats: cjs, esmNode.js VersionTested with JestCode Style: prettier

github flavor markdown spec

Autolinks are absolute URIs and email addresses inside < and >. They are parsed as links, with the URL or email address as the link label.

A URI autolink consists of <, followed by an absolute URI followed by >. It is parsed as a link to the URI, with the URI as the link’s label.

An absolute URI, for these purposes, consists of a scheme followed by a colon (:) followed by zero or more characters other than ASCII whitespace and control characters, <, and >. If the URI includes these characters, they must be percent-encoded (e.g. %20 for a space).

For purposes of this spec, a scheme is any sequence of 2322-32 characters beginning with an ASCII letter and followed by any combination of ASCII letters, digits, or the symbols plus (+), period (.), or hyphen (-).

An email autolink consists of <, followed by an email address, followed by >. The link’s label is the email address, and the URL is mailto: followed by the email address.

An email address, for these purposes, is anything that matches the non-normative regex from the HTML5 spec:



npm install --save @yozora/tokenizer-autolink



@yozora/tokenizer-autolink has been integrated into @yozora/parser / @yozora/parser-gfm-ex / @yozora/parser-gfm, so you can use YozoraParser / GfmExParser / GfmParser directly.

import YozoraParser from '@yozora/parser'

const parser = new YozoraParser()

// parse source markdown content




  • name: The unique name of the tokenizer, used to bind the token it generates, to determine the tokenizer that should be called in each life cycle of the token in the entire matching / parsing phase.

  • priority: Priority of the tokenizer, determine the order of processing, high priority priority execution. interruptable. In addition, in the match-block stage, a high-priority tokenizer can interrupt the matching process of a low-priority tokenizer.

    Exception: Delimiters of type full are always processed before other type delimiters.


@yozora/tokenizer-autolink produce Link type nodes. See @yozora/ast for full base types.

import type { Parent, Resource } from '@yozora/ast'

export const LinkType = 'link'
export type LinkType = typeof LinkType

* Link represents a hyperlink.
* @see
* @see
export interface Link extends Parent<LinkType>, Resource {}

Live Examples

  • URI autolink.

  • Email autolink.

  • Not autolinks.