Skip to content

Rewrite of maniaplanet/maniaplanet-style-js-parser

Notifications You must be signed in to change notification settings

AlteredNadeo/mpformat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maniaplanet Formatting Utilities

UMD/ESM TypeScript port of maniaplanet-style-js-parser with some tweaks.

Installation

$ npm i -S @altrd/mpformat

Usage

In node.js or browser via webpack/parcel/etc:

// node.js
const { parse, toHTML, toPlainText } = require('@altrd/mpformat')
// webpack/parcel/etc (TypeScript supported)
import { parse, toHTML, toPlainText } from '@altrd/mpformat'

const html = toHTML(parse('$f00Red')) // => '<span style="color: #ff0000;">Red</span>'
const text = toPlainText(parse('$f00Red')) // => 'Red'

In the browser via unpkg

<script src="https://unpkg.com/@altrd/mpformat"></script>
MPFormat.toHTML(MPFormat.parse('$f00Red'))

About

Rewrite of maniaplanet/maniaplanet-style-js-parser

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published