-
Notifications
You must be signed in to change notification settings - Fork 10
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
Usage of DOM to create HTML #211
base: master
Are you sure you want to change the base?
Conversation
@JettBurns14 #201 is kinda bothering me as its code needs to be converted too. |
Need to work out how to convert this part to DOM: Then remove this unused variable after: Also, I don't really like this code: |
I like this, but question: can you check some of our other code and see which way we created HTML there? JS DOM or strings? I can't remember the overall method we used, though I can tell we have a mix in this area. I like strings, since it's more compact and visual, but JS DOM may be more "correct". TBH we should technically use a lib like React DOM, designed exactly for this. Not sure if we can import just that part of React, otherwise if it's too large we should use something else. But yeah, let me know how we've mostly done it so far. |
I think I don't quite understand what you mean by other code. I went through most of the files and I changed the HTML strings but left the JS DOM parts of the code that already existed. For instance, in There are still one or two files left that I need to do the conversions for though. |
I just meant check other code in Yeah, go ahead and switch the string literals with HTML tags inside to JS DOM for all files. There are obviously places we don't need to convert the literals, like here, since they don't contain HTML. Be sure to double check all the elements you're re-writing, I believe you missed something earlier, which I'll point out. |
You shouldn’t need to use |
I don’t know what @JettBurns14 is talking about, I don’t know what |
Good point @matthiassaihttam, textContent would work better here. No need to escape that data then.
|
646a402
to
40dca1d
Compare
I have now completed the conversion of all of the HTML strings that I have found, so I've removed the draft status on the PR. |
This looked mostly good when I tested it. There were issues that arose from not properly rendering HTML in the notifications. I'll need to go through the code at some point and figure out where that issue is, and how Firefox would have us fix it. |
Hmm, I'm pretty sure I checked everything when I last updated this PR though. |
Related to #190
Conflicting changes with #201
The aim of this PR is simply to convert all of the strings used to create HTML code into JS DOM.
I have opened this as a draft PR for discussion and clarification purposes.