mirage/ocaml-cow — pull request #5 by Armael (2013-02-11 23:51:02+00:00)
Title: Some improvements of the markdown -> html export

Hello,
I currently use ocaml-cow's markdown export for a small project, and I tried to bring some improvements to the exported html.

- Headings, lists, quote and code blocs (

...) shouldn't be put in

...

blocks. The html w3c validator complains about that. A commit corrects this point.
- By adding two more lines following the same pattern than the existing ones, we can add support for h5 and h6 titles - that are supposed to be supported in markdown (inserted with ##### and ######)
- I add an option in the functions Xml.to_string (and thus Html.to_string) to specify an indentation level. The code was already written in the Xml lib, but the indentation level was hardcoded as None in the to_string function. This can help to have a pretty xml output (unfortunately, it kinda breaks html output that uses

sections, by adding extra '\n' between all content lines)
- It seems to me (and to the people I ask) that putting the attributes of a heading anchor into the heading tag itself is much better than putting them in an empty link, itself inside the heading (moreover, the current solution causes some css problems). Example of the modification brought by the commit, for a markdown "# Title":
before:

Title

now:

Title

Cheers !