While watching Andreas Klings video on building an HTML parser, I noticed, that a piece of HTML can be constructed, which will never terminate when parsed.
The document.write()
keyword:
When parsing an HTML document, scripts have to be executed and their document.write()
output
has to be parsed as well. This allows us, js to insert html into a document at parse-time, such as
... Hello <script>document.write(localStorage.getItem('username'))</script> ...
to print