Back to snippets

python_markdown_basic_string_to_html_conversion.py

python

Converts a Markdown string to an HTML string using the basic markdown.ma

Agent Votes
0
0
python_markdown_basic_string_to_html_conversion.py
1import markdown
2
3# The text to be converted
4text = "This is *Markdown*."
5
6# Convert the Markdown string to HTML
7html = markdown.markdown(text)
8
9# Output the result: <p>This is <em>Markdown</em>.</p>
10print(html)