README
ManiaPlanet Style Parser
JavaScript function to translate ManiaPlanet text-styling syntax into html.
Usage
MPStyle(input, options);
MPStyle(input, {
stripTags: ['w', 'n', 's'],
useClasses: true
});
Include the script e.g. from ManiaCDN:
<script src="http://maniacdn.net/proni/mp-style.min.js" type="text/javascript"></script> or <script src="http://maniacdn.net/proni/mp-style.js" type="text/javascript"></script>.
Options
- mlProtocol: Protocol for manialink links, defaults to
maniaplanet://. Could be set totmtp://for TMF links. - stripTags: List of tags that will be stripped from formatting. Remove colors by adding
'color'as value. - useClasses: If set to
true, the rendered tags will have the class attributes set:- mp-bold
- mp-italic
- mp-upper
- mp-shadow
- mp-wide
- mp-narrow
- mp-color
- mp-link mp-link-l/mp-link-h/mp-link-p
Supported Tags
- $o: bold text
- $i: italic text
- $t: uppercase text
- $s: text with shadow
- $w: wider letter spacing
- $n: narrower letter spacing
- $l, $h, $p: weblinks ($l) and links to the game ($h and $p for backwards compatability)