@@ -0,0 +1,1601 @@
+import string%0Awhile(1):%0A    # Take input from the user:%0A    md = str(raw_input(%22Enter some markdown: %22))%0A%0A    # Have we found bold or italic characters yet?%0A    bold = False%0A    italics = False%0A    # No. That's why these are false.%0A%0A    # Replace some characters so the string is easier to work with:%0A    md = string.replace(md, %22***%22, %22*_%22)%0A    md = string.replace(md, %22**%22, %22_%22)%0A    print md%0A%0A    # Change the user input into a list:%0A    html = list(md)%0A%0A    for letter in  range(len(html)):%0A    # Bold code:%0A            if html%5Bletter%5D == %22_%22 and bold == False:%0A                html%5Bletter%5D = %22%3Cstrong%3E%22%0A                # Awesome! We found a bold character! Switch that baby to true!%0A                bold = True%0A%0A            if html%5Bletter%5D == %22_%22 and bold == True:%0A                html%5Bletter%5D = %22%3C/strong%3E%22%0A                # That's all, folks!%0A                bold = False%0A%0A    # Italics code:%0A            if html%5Bletter%5D == %22*%22 and italics == False:%0A                html%5Bletter%5D = %22%3Cem%3E%22%0A                # Italic character found, sweet! Make sure our bool knows it.%0A                italics = True%0A%0A            if html%5Bletter%5D == %22*%22 and italics == True:%0A                # If the user did ***, switch current order so it ends %3C/strong%3E %3C/em%3E%0A                if html%5Bletter + 1%5D == %22_%22:%0A                    html%5Bletter%5D = %22%3C/strong%3E%22%0A                    html%5Bletter + 1%5D = %22%3C/em%3E%22%0A                else:%0A                    html%5Bletter%5D = %22%3C/em%3E%22%0A                # No more italics for you, that's a shame. (End of it found.)%0A                italics = False%0A%0A    html = %22%22.join(html)%0A    print html%0A

Add markdown_to_HTML.py