Closed viveksjain closed 2 years ago
Does it remove the classes?
Maybe it's just the popup messages messing up the format? They get appended to the Body element.
Yup, I definitely see it removing the classes. Should be pretty straightforward to repro but let me know if I should provide an example.
It's probably just https://github.com/yandeu/five-server/blob/2fb91e2a55a72c67e49b5f9f3f0ad7fc022a8da5/client/injected.ts#L199.
I will check it soon 👍🏻
Thanks so much for the quick fix! I took a quick look at the code, looks like you already have the object newBody
, can that be used directly for diff? Fixing id and class is good enough for me but technically it still doesn't handle some attributes.
I can't remember why I used tmp
instead of newBody
for diffing.
I believe domParser
is just there to throw an error if d
is invalid.
Hot reload with injectBody looks awesome, however, it seems to clear the
class
attribute on body which messes up some of the formatting on my HTML.