I have a tool in place that shows files from a specific directory in a data table. The user is able to click on those files and can show their contents in another div. I have this working for markdown files since there is a nice and easy component for rendering. However, the other file type is fairly complicated HTML (generated from converting word -> html). Would it be best to display this content in an iframe? If so, whats the best way to offer local files. Or, is it possible to use the HTML core components to display it?
For security reasons (XSS), it is not possible to render raw HTML. However, a current workaround is to display the HTML string inside the
srcDoc attribute of an IFrame. Here’s an example:
Awesome! That did the trick, thank you!