Merge pull request #248 from PaulBGD/parse-numbers-correctly-ssr

Fix partial numbers being detected as numbers but in SSR code
pull/254/head
Rich Harris 8 years ago committed by GitHub
commit d5648df509

@ -21,7 +21,7 @@ export default {
} else if ( attribute.value.length === 1 ) {
const chunk = attribute.value[0];
if ( chunk.type === 'Text' ) {
value = isNaN( parseFloat( chunk.data ) ) ? JSON.stringify( chunk.data ) : chunk.data;
value = isNaN( chunk.data ) ? JSON.stringify( chunk.data ) : chunk.data;
} else {
const { snippet } = generator.contextualise( chunk.expression );
value = snippet;

Loading…
Cancel
Save