0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Fixed html attributes not showing in design settings preview

no issue

- by using `innerHTML` we were missing the lang and class attributes on the `<html>` element that are added by themes, breaking things like dark mode
- switching to `outerHTML` includes the `<html>` element and is handled automatically by iframes when writing to the `contentWindow`
This commit is contained in:
Kevin Ansfield 2021-10-11 15:03:49 +01:00
parent de5674ebd4
commit 7eda410dc3

View file

@ -126,7 +126,7 @@ export default class ThemeManagementService extends Service {
stylesheet.innerHTML = `${originalCSS}\n\n${injectedCss}`;
// replace the iframe contents with the doctored preview html
this.previewHtml = htmlDoc.documentElement.innerHTML;
this.previewHtml = htmlDoc.documentElement.outerHTML;
}
get previewData() {