Embedded topic iframe truncates content when a Details element is expanded

When embedding discourse in an external site, I see that Discourse calculates the height of the iframe based on the height of the contents. In the case of posts that make use of the HTML5 Details element (via [details="title"]...[/details]), this height changes when the user toggles the visibility of the Details. As a result, when you expand Details, some content in the embedded post is not visible because it is positioned below the bottom of the iframe.

I imagine two possible solutions:

  1. Discourse could calculate the height of the iframe in the fully-expanded state, with all [details] visible.
  2. Discourse could automatically resize the iframe whenever a user toggles a [details] element.