Parse markdown to html in python
Budget: $10 – $30 USD
I need some help on a Django templeate. Using the re module I would like the user to style headings, paragraphs, bold text, links and lists in a textarea. On another page I see the result in html.
Just need backend, no css or javascript.
below is a draft of what I'm trying to achieve.
markdown.py file
import re
markdown_text = 'Make the World a *Better Place*'
bold_pattern = r'\*(.*?)\*'
replacement = r'<b>\1<\\b>'
html_text = re.sub(bold_pattern, replacement, markdown_text)
print(html_text)
views.py
Function that calls markdown.py to parse any text before showing the html
Or maybe markdown.py could be used directly in html template using {%load markdown%}
Some research, I can't make it work yet, I'll appreciate a simple work that I could understand, no extra code.
https://regex101.com/r/fN3jU0/1
https://www.pythontutorial.net/python-regex/python-regex-sub/
Just need backend, no css or javascript.
below is a draft of what I'm trying to achieve.
markdown.py file
import re
markdown_text = 'Make the World a *Better Place*'
bold_pattern = r'\*(.*?)\*'
replacement = r'<b>\1<\\b>'
html_text = re.sub(bold_pattern, replacement, markdown_text)
print(html_text)
views.py
Function that calls markdown.py to parse any text before showing the html
Or maybe markdown.py could be used directly in html template using {%load markdown%}
Some research, I can't make it work yet, I'll appreciate a simple work that I could understand, no extra code.
https://regex101.com/r/fN3jU0/1
https://www.pythontutorial.net/python-regex/python-regex-sub/