Skip to main content
Version: 3.x.x 🚧


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

github flavor markdown spec

A sequence of non-blank lines that cannot be interpreted as other kinds of blocks forms a paragraph. The contents of the paragraph are the result of parsing the paragraph’s raw content as inlines. The paragraph’s raw content is formed by concatenating the lines and removing initial and final whitespace.


npm install --save @yozora/tokenizer-paragraph



@yozora/tokenizer-paragraph 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.


@yozora/tokenizer-paragraph produce Paragraph type nodes. See @yozora/ast for full base types.

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

export const ParagraphType = 'paragraph'
export type ParagraphType = typeof ParagraphType

* Paragraph represents a unit of discourse dealing with a particular
* point or idea.
* @see
* @see
export type Paragraph = Parent<ParagraphType>

Live Examples

  • Basic.

  • Paragraphs can contain multiple lines, but no blank lines.

  • Multiple blank lines between paragraph have no effect.

  • Leading spaces are skipped.

  • Lines after the first may be indented any amount, since indented code blocks cannot interrupt paragraphs.

  • However, the first line may be indented at most three spaces, or an indented code block will be triggered.

  • Final spaces are stripped before inline parsing, so a paragraph that ends with two or more spaces will not end with a hard line break.