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

Breaks on funny/broken HTML #249

Open
Prinzhorn opened this issue Mar 14, 2024 · 0 comments
Open

Breaks on funny/broken HTML #249

Prinzhorn opened this issue Mar 14, 2024 · 0 comments

Comments

@Prinzhorn
Copy link

Prinzhorn commented Mar 14, 2024

I assume this is expected behavior, but I was kind of expecting morphdom to handle everything I throw at it.

This happened during live editing of markdown that is rendered using morphdom. The minimal repro is this :

const wrapper = document.createElement('div');

morphdom(wrapper, `<div><hr /></div>`);
morphdom(wrapper, `<div><hr /</div>`);

In reality I was literally just pressing backspace and removed the >. The above will throw

morphdom-umd.js:43 Uncaught DOMException: Failed to execute 'setAttribute' on 'Element': '<' is not a valid attribute name.

I'm aware that this HTML is broken, I just wasn't expecting morphdom to throw for some reason. The browser will happily turn this into "something", as it can't just crash obviously.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant