Hyperhtml: What is this html comment with a percent added to changed nodes?

Created on 29 Mar 2019  路  3Comments  路  Source: WebReflection/hyperHTML

It looks like hyperhtml is adding weird comments to nodes that it changes, that look like <!---0.461211%-->. This is failing our nightwatch tests, which use innnerHTML to compare before and after dom content, which is including this bizarre comment. Is it hyperhtml that is adding this? Is it possible for me to disable this comment?

help wanted invalid question

Most helpful comment

From my understanding those comments are vital to how hyperHTML works. I
don鈥檛 know the exact inner workings, but I believe it uses the exact nodes
those comments create to be able to re-render content in a highly efficient
manner.

All 3 comments

From my understanding those comments are vital to how hyperHTML works. I
don鈥檛 know the exact inner workings, but I believe it uses the exact nodes
those comments create to be able to re-render content in a highly efficient
manner.

Is it hyperhtml that is adding this?

Yes.

Is it possible for me to disable this comment?

No, that's how hyperHTML, or lit-html, or anything that needs to understand where your holes in your template literals were, reflects on the DOM.

This is failing our nightwatch tests, which use innnerHTML

Don't use innerHTML, it's been bad since day zero, why would you trust it for tests at all?

P.S. you can, however, just remove /<!--(?:-?\d\.\d+%)-->/g out of the equation, and you might be good to go with your innerHTML based tests 馃憢

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davidmerrique picture davidmerrique  路  7Comments

ansarizafar picture ansarizafar  路  8Comments

zaclummys picture zaclummys  路  3Comments

jaschaio picture jaschaio  路  5Comments

BentleyDavis picture BentleyDavis  路  8Comments