blog

Add markdown module

I was originally planning to use the markdown library you can find at PyPI, but that thing is so terribly awful and badly written that I simply cannot use it for my blog, it's just too bad. So I'll be writing my own implementation, which will take some time, but at least not as much as I'll have to spend to make the current shit work properly.

Author
Maarten 'Vngngdn' Vangeneugden
Date
July 11, 2017, 4:54 p.m.
Hash
dfc1bea9bc6a47546d45a9b0bd70779a63cf34c0
Parent
754c93cf11faf4bde462aebfb371b00319fa3258
Modified file
markdown.py

markdown.py

25 additions and 0 deletions.

View changes Hide changes
+
1
fucking shit, I've decided to write my own implementation. Contary to the one in
+
2
PyPI, my version handles **all** cases, and is a **full implementation** of the
+
3
reference.
+
4
"""
+
5
+
6
def toHTML(
+
7
        file,
+
8
        emphasis = "<em>",
+
9
        emphasis_end  ="</em>",
+
10
        strong = "<strong>",
+
11
        strong_end = "</strong>",
+
12
        unordered_list = "<ul>",
+
13
        unordered_list_end = "</ul>",
+
14
        ordered_list = "<ol>",
+
15
        ordered_list_end = "</ol>",
+
16
        list_item = "<li>",
+
17
        list_item_end = "</li>",
+
18
        hyperlink = "<a href=\"{0}\">",
+
19
        hyperlink_end = "</a>",
+
20
        image = "<img src=\"{0}\">",
+
21
        image_end = "</img>",
+
22
        ):
+
23
    # Zoom zoom insert magic code here
+
24
    return markdown_code
+
25