mhmarkdown handler

About

This is a much more stripped down version of the famous 'md2html.awk' by Jesus Galan (yiyus) 2009

Rationale

Unless you are caching the .html generated, awk is already a sub-optimal choice to use for a md2html convertor when there exists tools like SMU, written in C

I don't know C and I was already learning awk

Less logic, less sytem-calls, less CPU cycles

Features lack thereof

Installation

Get it from git

Some differences

There are many differences but this is a small example

This was responsible for converting # to its appropriate <h1> tag

/^#+/ && (!newli || par=="p" || /^##/)
{ for(n = 0; n < 6 && sub(/^# */, ""); n++)
 sub(/#$/, ""); par = "h" n; }

Less logic is needed for this

/^# / { par = "h1"; sub(/^# +/, ""); }
(/^## /) { par = "h2"; sub(/^## +/, ""); }
(/^### /) { par = "h3"; sub(/^### +/, ""); }

Bugs

% has to be escaped via '%%'