diff --git a/src/rebuild.ts b/src/rebuild.ts index 4a42d5be..c9be6d23 100644 --- a/src/rebuild.ts +++ b/src/rebuild.ts @@ -128,6 +128,11 @@ function buildNode( try { if (n.isSVG && name === 'xlink:href') { node.setAttributeNS('http://www.w3.org/1999/xlink', name, value); + } else if (name == 'onload' || name == 'onclick' || name.substring(0, 7) == 'onmouse') { + // Rename some of the more common atttributes from https://www.w3schools.com/tags/ref_eventattributes.asp + // as setting them triggers a console.error (which shows up despite the try/catch) + // Assumption: these attributes are not used to css + node.setAttribute('_' + name, value); } else { node.setAttribute(name, value); }