mirror of
https://github.com/suitenumerique/docs
synced 2026-04-21 13:37:20 +00:00
🐛(backend) format html when generate document
When we converted from markdown to html, we didn't format the html, so it was displayed like a string in our pdf. We now format_html the html before we generate the pdf.
This commit is contained in:
parent
2665b707db
commit
cc64b8c8b5
1 changed files with 2 additions and 1 deletions
|
|
@ -11,6 +11,7 @@ from django.core import mail, validators
|
|||
from django.db import models
|
||||
from django.template.base import Template as DjangoTemplate
|
||||
from django.template.context import Context
|
||||
from django.utils.html import format_html
|
||||
from django.utils.functional import lazy
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
|
@ -191,7 +192,7 @@ class Template(BaseModel):
|
|||
|
||||
document_html = HTML(
|
||||
string=DjangoTemplate(self.code).render(
|
||||
Context({"body": body_html, **metadata})
|
||||
Context({"body": format_html(body_html), **metadata})
|
||||
)
|
||||
)
|
||||
css = CSS(
|
||||
|
|
|
|||
Loading…
Reference in a new issue