Content type.

This commit is contained in:
retoor 2025-01-27 23:31:08 +01:00
parent 1447a16bd1
commit 745d076fc8

View File

@ -57,9 +57,11 @@ class TemplateView(BaseView):
context['json'] = None
if str(path.endswith('.md')):
renderer = MarkdownRenderer(self.request.app, path)
return web.Response(text=renderer.render(),content_type="text/html")
return web.Response(text=renderer.render(), content_type='text/html', charset='utf-8', **context)
return await super().render_template(path, self.request)
reponse = await super().render_template(path, self.request, context)
response.headers['Content-Type'] = 'text/html'
return response
async def get(self):
path = await self.resolve_template(self.request.match_info['tail'])