loincloth

This gem parses a subset of MarkDown, in an inefficient way, both in terms of speed and memory. I call that subset PoloDown.

If you are thinking using this on a production environment … well, I admire you. But I really think you should give the proper-MarkDown-parsing gems (Maruku, BlueCloth, etc) a look first.

Also, going to the doctor would not hurt.

Target

The target is being able to convert headers (level 1 and 2 only), paragraphs, lists (unordered, one level), emphasized text & strong text (stars only), links and images (inline only).

A First Level Header
====================

A Second Level Header
---------------------

Now is the time for all *good* men to come to
the aid of **their** country. This is just a
regular paragraph.

* Get socks
* Get milk
* [Get firefox](http://getfirefox.com)

![my cat playing with a ball](/images/cat.jpg)

Should produce:

<h1>A First Level Header</h1>

<h2>A Second Level Header</h2>

<p>Now is the time for all <em>good</em> men to come to
the aid of <strong>their</strong> country. This is just a
regular paragraph.</p>

<ul>
  <li>Get socks</li>
  <li>Get milk</li>
  <li><a href="http://getfirefox.com" title="Get firefox">Get firefox</a></li>
</ul>

<p><img src="/images/cat.jpg" alt="my cat playing with a ball" title="my cat playing with a ball" /></p>

Other notes:

Tests

This gem uses my testing gem, assertor, for tests.

Consider that a business requirement. Sorry.

Contributing to loincloth

Copyright © 2011 Enrique García Cota. See LICENSE.txt for further details.