ema icon indicating copy to clipboard operation
ema copied to clipboard

Malformed HTML breaks morphdom (link click fails)

Open srid opened this issue 4 years ago • 1 comments

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">

srid avatar Dec 24 '21 19:12 srid

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.

srid avatar Dec 24 '21 19:12 srid