Skip to content

bermanboris/create-markup-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

3e9c6bf · Feb 13, 2022

History

38 Commits
Apr 13, 2019
Apr 13, 2019
Apr 13, 2019
Apr 13, 2019
Apr 13, 2019
Apr 13, 2019
Apr 13, 2019
Feb 13, 2022
Apr 13, 2019
Jun 18, 2019
Apr 13, 2019
Apr 13, 2019
Apr 13, 2019
Aug 29, 2019

Repository files navigation

Build Status npm version

Create Markup Parser

Building your markup language was never been that easy. This library is built using Non-deterministic Finite Automata concepts in mind, which simplifies the readability and maintainability of the source code.

Usage

yarn add create-markup-parser
# or
npm install create-markup-parser

Importing library

You can import the generated bundle to use the whole library generated by this starter:

import { createMarkupParser } from 'create-markup-parser'

// Create custom markup parser
const parser = createMarkupParser({
  '^': character => character.toUpperCase(),
  '_': character => character.toLowerCase(),
  '#': () => undefined
})

const input = 'Hello ^dear^. Good to see _YOU_ #again#'
const output = parser.parse(input)

console.log(output) // Hello DEAR. Good to see you