neutronX / django-markdownx

Comprehensive Markdown plugin built for Django
https://neutronx.github.io/django-markdownx/
Other
839 stars 152 forks source link

Load HTML in iframe? #262

Open triopter opened 6 months ago

triopter commented 6 months ago

Love this module, but there's one big issue I'm having with it, which is that it uses the admin's default styling, making it basically impossible to show unstyled HTML rendering, and excruciating to show it with the styles you'll use on the front-end. In particular, the way <ul> and <h2> elements are displayed are very opinionated in the admin in ways that don't translate to typical article rendering.

This could be fixed by loading the HTML using an iframe instead of a div. Is that something you'd consider implementing? I'll monkey-patch the javascript if I have to, but from what I can tell, that will be pretty fragile as a hack and also requires a bunch of CSP munging.

Example of undesirable rendering:

Screenshot 2024-01-15 at 5 17 53 PM