Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 879 Bytes

README.md

File metadata and controls

30 lines (20 loc) · 879 Bytes

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);