2.3.1 • Published 3 months ago

@yozora/parser-gfm-ex v2.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

A markdown parser with built-in tokenizers to fully support GFM and GFM extensions.

See @yozora/parser-gfm-ex documentation for details.

Install

  • npm

    npm install --save @yozora/parser-gfm-ex
  • yarn

    yarn add @yozora/parser-gfm-ex

Usage

  • Basic

    import GfmExParser from '@yozora/parser-gfm-ex'
    
    const parser = new GfmExParser()
    
    // parse markdown source content.
    parser.parse('source markdown content')
    
    // parse markdown source content with custom options.
    parser.parse(
      'source markdown content',  // markdown source contents, `string|Iterable<string>`
      {},                         // ParseOptions, optional.
    )
    
    // parse multiple markdown source content pieces.
    parser.parse(['source', 'contents'])
  • Use withing generator:

    import GfmExParser from '@yozora/parser-gfm-ex'
    
    const parser = new GfmExParser()
    
    /**
     * String stream is supported through the iterator API.
     */
    function* source () {
      yield 'hello',
      yield 'world',
    }
    
    parser.parse(source())

Options

  • Constructor Options

    NameTypeRequiredDescription
    blockFallbackTokenizerBlockFallbackTokenizerfalseFallback tokenizer on processing block structure phase
    inlineFallbackTokenizerInlineFallbackTokenizerfalseFallback tokenizer on processing inline structure phase
    defaultParseOptionsParseOptionsfalseDefault options for parse()
  • ParseOptions

    NameTypeRequiredDescription
    shouldReservePositionbooleanfalseWhether it is necessary to reserve the position in the Node produced
    presetDefinitionsArray<Omit<Definition, 'type'>falsePreset definitions
    presetFootnoteDefinitionsArray<Omit<FootnoteDefinition, 'type'>falsePreset footnote definition

Overview

Related

2.3.1

3 months ago

2.2.0

9 months ago

2.3.0

8 months ago

2.1.5

12 months ago

2.1.2

1 year ago

2.1.1

1 year ago

2.1.4

1 year ago

2.1.3

1 year ago

2.0.6

1 year ago

2.0.5-alpha.0

1 year ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.5

1 year ago

2.0.4

2 years ago

2.0.2-alpha.0

2 years ago

2.0.1

2 years ago

2.0.0-alpha.3

2 years ago

2.0.0-alpha.0

2 years ago

2.0.0-alpha.1

2 years ago

2.0.0-alpha.2

2 years ago

2.0.0

2 years ago

1.3.0

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.2.0-alpha.1

3 years ago

1.2.0-alpha.0

3 years ago

1.1.0

3 years ago

1.1.0-alpha.2

3 years ago

1.1.0-alpha.1

3 years ago

1.1.0-alpha.0

3 years ago

1.0.0

3 years ago

1.0.0-beta.0

3 years ago

1.0.0-alpha.29

3 years ago

1.0.0-alpha.27

3 years ago

1.0.0-alpha.28

3 years ago

1.0.0-alpha.26

3 years ago

1.0.0-alpha.25

3 years ago

1.0.0-alpha.23

3 years ago

1.0.0-alpha.24

3 years ago

1.0.0-alpha.21

3 years ago

1.0.0-alpha.20

3 years ago

1.0.0-alpha.22

3 years ago

1.0.0-alpha.19

3 years ago

1.0.0-alpha.18

3 years ago

1.0.0-alpha.17

3 years ago

1.0.0-alpha.16

3 years ago

1.0.0-alpha.15

3 years ago

1.0.0-alpha.14

3 years ago