diff --git a/src/generators/dom/visitors/attributes/addComponentAttributes.js b/src/generators/dom/visitors/attributes/addComponentAttributes.js index d1c70a574a26..e3471c6d3745 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 = isNaN( parseFloat( 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 diff --git a/test/generator/attribute-partial-number/Component.html b/test/generator/attribute-partial-number/Component.html new file mode 100644 index 000000000000..c48ee295fcad --- /dev/null +++ b/test/generator/attribute-partial-number/Component.html @@ -0,0 +1 @@ +
diff --git a/test/generator/attribute-partial-number/_config.js b/test/generator/attribute-partial-number/_config.js new file mode 100644 index 000000000000..acb585989730 --- /dev/null +++ b/test/generator/attribute-partial-number/_config.js @@ -0,0 +1,3 @@ +export default { + html: '' +}; diff --git a/test/generator/attribute-partial-number/main.html b/test/generator/attribute-partial-number/main.html new file mode 100644 index 000000000000..7f56dcb44775 --- /dev/null +++ b/test/generator/attribute-partial-number/main.html @@ -0,0 +1,11 @@ +