0.2.0 • Published 3 years ago

@altrd/mpformat v0.2.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

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 = toHTML(parse('$f00Red')) // => 'Red'

In the browser via unpkg

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

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago