diff --git a/src/generators/dom/visitors/attributes/addComponentAttributes.js b/src/generators/dom/visitors/attributes/addComponentAttributes.js index 77bc99ea4c..e3471c6d37 100644 --- a/src/generators/dom/visitors/attributes/addComponentAttributes.js +++ b/src/generators/dom/visitors/attributes/addComponentAttributes.js @@ -28,7 +28,7 @@ export default function addComponentAttributes ( generator, node, local ) { if ( value.type === 'Text' ) { // static attributes - const result = String( parseFloat( value.data ) ) !== value.data ? JSON.stringify( value.data ) : value.data; + const result = isNaN( value.data ) ? JSON.stringify( value.data ) : value.data; local.staticAttributes.push({ name: attribute.name, value: result