diff --git a/CHANGELOG.md b/CHANGELOG.md index 72da180..8959ae5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ## [Unreleased] +### Fixed +- **Article editor preview now renders HTML correctly** — replaced the raw `{{ body_html }}` div (which Jinja2 auto-escaped to literal `

...

` text) with a sandboxed ` + {% else %} +

Start writing to see a preview.

+ {% endif %} @@ -423,4 +397,17 @@ + {% endblock %} diff --git a/web/src/padelnomics/admin/templates/admin/partials/article_preview.html b/web/src/padelnomics/admin/templates/admin/partials/article_preview.html index 92fba48..7630039 100644 --- a/web/src/padelnomics/admin/templates/admin/partials/article_preview.html +++ b/web/src/padelnomics/admin/templates/admin/partials/article_preview.html @@ -1,5 +1,12 @@ -{% if body_html %} -
{{ body_html }}
+{# HTMX partial: sandboxed iframe showing a rendered article preview. + Rendered by POST /admin/articles/preview. #} +{% if preview_doc %} + {% else %}

Start writing to see a preview.

{% endif %}