Skip to content

BowlerHatLLC/haxe-markdown-openfl-textfield

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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