Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Malformed HTML breaks morphdom (link click fails) #65

Open
srid opened this issue Dec 24, 2021 · 1 comment
Open

Malformed HTML breaks morphdom (link click fails) #65

srid opened this issue Dec 24, 2021 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers morphdom
Milestone

Comments

@srid
Copy link
Owner

srid commented Dec 24, 2021

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 srid added the bug Something isn't working label Dec 24, 2021
@srid srid pinned this issue Dec 24, 2021
@srid srid added the good first issue Good for newcomers label Dec 24, 2021
@srid
Copy link
Owner Author

srid commented Dec 24, 2021

Basically, we should handle exceptions from JavaScript around here - and display them in the browser:

ema/src/Ema/Server.hs

Lines 211 to 212 in 06402ea

var htmlElem = htmlToElem(html);
morphdom(elm, html);

Make it clear to the user that they are responsible to fix malformed HTML being sent.

@srid srid added this to the 1.0 milestone Jan 21, 2022
@srid srid added the morphdom label Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers morphdom
Projects
None yet
Development

No branches or pull requests

1 participant