Generally, the image fails to load for 2 reasons:
- An invalid src.
- A poor internet connection.
How to handle that using the onerror
event?
Edit: More details:
So, to be more specific, I made a function for my markdown renderer which can render embeds using the image syntax 
.
The output will be:
<img src="https://example.com" alt="caption" onerror="renderEmbed(this)"></img>
Since the invalid src url will be used to render embeds, a poor connection with a valid url will be a mess.