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

innerHTML is used in places where DOMParser should be used #367

Open
GarboMuffin opened this issue Jan 22, 2023 · 1 comment
Open

innerHTML is used in places where DOMParser should be used #367

GarboMuffin opened this issue Jan 22, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@GarboMuffin
Copy link

Consider these functions:

var div = document.createElement("div");
div.innerHTML = data;

var div2 = document.createElement("div");
div2.innerHTML = followersData;

var div = document.createElement("div");
div.innerHTML = html.replaceAll("<!DOCTYPE html>", "");

It is my belief that these functions should use the DOMParser API instead of actual DOM elements

@GarboMuffin GarboMuffin added the bug Something isn't working label Jan 22, 2023
@GarboMuffin GarboMuffin changed the title innerHTML is used in places where DOMParser should be used innerHTML is used unnecessarily in very many places Jan 22, 2023
@GarboMuffin GarboMuffin changed the title innerHTML is used unnecessarily in very many places innerHTML is used in places where DOMParser should be used Jan 22, 2023
@GarboMuffin
Copy link
Author

This project has a general issue of using innerHTML in way too many places unnecessarily. This issue is just the tip of the iceberg in that regard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant