Question from Project 1 in CS50W
I'm stuck trying to get the markdown info from files to my HTML. I manage to get the markdown info into a HTML string, but when I input it to my HTML I get the same string, it won't take them as different elements. Something like this:
The code I'm using in views.py is the following:
def entry(request, title):
info = util.get_entry(title)
if info == None:
info = "File Not Found"
else:
info = markdown.markdown(info)
print(info)
return render(request, "encyclopedia/entry.html", {
"title": title,
"info": info
})
And the code in my HTML:
{% extends "encyclopedia/layout.html" %}
{% block title %}
{{ title }}
{% endblock %}
{% block body %}
{{ info }}
{% endblock %}
Thanks in advance for the support!