Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #359 from serlo/embed-backup-handling-using-iframe
Browse files Browse the repository at this point in the history
feat(edusharing-asset): Render content where no type could be determined in iframe
  • Loading branch information
LarsTheGlidingSquirrel authored Mar 20, 2024
2 parents 970912d + ec9763d commit 1153464
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/frontend/plugins/edusharing-asset/renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,13 @@ export function EdusharingAssetRenderer(props: {
}
}

// If the detailsSnipped was not handled by one of the handlers above, change nothing in html snippet
// Backup when content type could not be determined above -> Render in iframe with iframe-resizer.
// This will make sure <script> tags execute. They would not if using 'dangerously-set-inner-html'
return {
html: detailsSnippet,
renderMethod: 'dangerously-set-inner-html',
html:
detailsSnippet +
'<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.9/iframeResizer.contentWindow.min.js"></script>',
renderMethod: 'iframe',
defineContainerHeight: false,
}
}
Expand Down

0 comments on commit 1153464

Please sign in to comment.