chamberlainpi
chamberlainpi

Reputation: 5241

AS3 library for Markdown syntax usable on Textfield.htmlText

Is there a stable Markdown library that can be used on Flash TextField objects's htmlText properties?

There is this one that was recommended in a similar question: ActionScript library to convert Markdown to HTML

But doesn't seem to work even if I embed the bold, italic, italic+bold versions of the font (ex: Arial). Plus it seems to leave a bunch of blank lines in between each lines of text.

I'm basically testing it out with this string:

Vanilla Muffin
============

Ingredients:
--------------

- 1 tbsp. **Vanilla** extract
- Muffin**mix**

Directions:

- Mix vanilla with muffin mix.
- place in a muffin pan.
- Bake it!

TADA!

Know of any good Markdown port to AS3?

EDIT: Stackoverflow's formatting seems to apply color to the markdown example above, that should be plain text (just so you know).

Upvotes: 0

Views: 286

Answers (1)

TiagoLing
TiagoLing

Reputation: 131

I didn't find anything like you want for AS3, however there are two libraries in Haxe which you can use as a base for creating your own:

https://github.com/jasononeil/mdown (This one works in Haxe 2.x)

https://github.com/dpeek/haxe-markdown (This one works with Haxe 3.x)

While not in the same language, Haxe has a sintax very similar to AS3, which makes it easy enough to port / understand and apply to your specific case.

EDIT: If you need to create a SWC to use with Flash Professional, take a look at this question, which links to a repository with examples on how to do it (compatible with Haxe 3.x):

Can we use compiled HAXE swf's swc's in Actionscript as normal libs?

Hope this helps!

Upvotes: 1

Related Questions