ema
ema copied to clipboard
Malformed HTML breaks morphdom (link click fails)
If the HTML served is malformed, the dev server's web socket code is unable to switch to the new page on link clicks because morphdom fails to apply the new HTML. The user will see the new URL appear in address bar, but the HTML itself wouldn't change.
Proposal: have Ema display a 'Bad HTML' error message in place.
Here's one malformed HTML:
<meta property="og:title" content="Posts tagged " non-tech" - Maralorns Blog">
Basically, we should handle exceptions from JavaScript around here - and display them in the browser:
https://github.com/srid/ema/blob/06402ea7f368e161d9865038cdcb4d4ef2a4ec86/src/Ema/Server.hs#L211-L212
Make it clear to the user that they are responsible to fix malformed HTML being sent.