I have noticed that browsers will encode left bracket <, right bracket >, and ampersand & into their respective codes (</>/&) when reading the innerHTML of a TXT-file source iframe. How do I stop this from happening? The innerHTML will also be wrapped in a <pre> tag as well.
For example, suppose I have the following inside a TXT (not HTML) file:
Hello world! I love M&M's candy.
<iframe id="MyIframe" src="/hello.txt"></iframe>
var MyIframe = document.getElementById('MyIframe');
<div>Hello world! I love M&M's candy.</div>
Instead of retrieving
.textContent. This should return only the human-readable text in an element tree, in a human-readable form. You can try it out on this page by Inspect-ing one of your HTML samples in your question, and writing
$0.textContent in the developer console.