BowlerHatLLC / haxe-markdown-openfl-textfield

A Markdown parser in Haxe, targeting the OpenFL TextField class

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Markdown for OpenFL

Extends the Haxe Markdown library to support the htmlText property of OpenFL's TextField class. A very limited subset of HTML is supported by TextField, so the normal HTML generated by Markdown needs to be simplified.

Install

Run the following command in a terminal.

haxelib install markdown-openfl-textfield

Then, add the following line to your OpenFL project.xml file.

<haxelib name="markdown-openfl-textfield" />

Usage

The following example displays Markdown in an openfl.text.TextField using its htmlText property.

var rawMarkdown = "Hello, **world**!";
var htmlText = TextFieldMarkdown.markdownToHtml(rawText);

var textField = new TextField();
textField.htmlText = htmlText;
this.addChild(htmlText);

About

A Markdown parser in Haxe, targeting the OpenFL TextField class

License:MIT License


Languages

Language:Haxe 100.0%