django-markdownx icon indicating copy to clipboard operation
django-markdownx copied to clipboard

Load HTML in iframe?

Open triopter opened this issue 1 year ago • 0 comments

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

triopter avatar Jan 15 '24 22:01 triopter