mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-26 09:16:10 -06:00
render markdown directly in template
This commit is contained in:
parent
58a7216d2d
commit
ed9e95911c
@ -893,17 +893,8 @@ class JobResultBulkDeleteView(generic.BulkDeleteView):
|
||||
#
|
||||
|
||||
class MarkdownRenderView(View):
|
||||
# _ignore_model_permissions = True
|
||||
template_code = """
|
||||
{% if text %}
|
||||
{{ text|markdown }}
|
||||
{% else %}
|
||||
—
|
||||
{% endif %}
|
||||
"""
|
||||
|
||||
def post(self, request):
|
||||
context = {
|
||||
"text": request.POST.get("text", "")
|
||||
}
|
||||
return HttpResponse(Template(self.template_code).render(Context(context)).strip())
|
||||
return HttpResponse(Template("{{text|markdown}}").render(Context(context)).strip())
|
||||
|
Loading…
Reference in New Issue
Block a user