waldyrious / rst-playground

Browser-based reStructuredText playground, built on Pyodide and docutils.
https://waldyrious.github.io/rst-playground
ISC License
1 stars 4 forks source link

Fix iframe reload bug #12

Closed waldyrious closed 1 year ago

waldyrious commented 1 year ago

Set iframe content via srcdoc. Fixes #7.

Split from #6 (depends on it being merged first).

waldyrious commented 1 year ago

I've amended the commit with a couple additional changes, and added a more detailed commit message, which I'm copying here for convenience:

Set iframe content via srcdoc

This fixes the iframe reloading bug in Firefox, where the page would load correctly the first time, but on subsequent loads the iframe would load the root page nested into it.

Also replace the <output> element with the <iframe>, at least while custom parsing of the docutils output is not implemented. The <output> element can be reintroduced later if appropriate.

Finally, rename the JS variables for DOM elements to reflect the element type.

waldyrious commented 1 year ago

Merging as I've obtained @not-my-profile's approval via chat on Matrix.