From 4fe20fb383d4265502b33757b0247d518fb730b9 Mon Sep 17 00:00:00 2001 From: Rich-Harris Date: Tue, 25 Apr 2017 15:01:26 -0400 Subject: [PATCH] sanitize element names in preprocess step --- src/generators/dom/preprocess.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/generators/dom/preprocess.js b/src/generators/dom/preprocess.js index 6009f4dec8..8661dbb0fb 100644 --- a/src/generators/dom/preprocess.js +++ b/src/generators/dom/preprocess.js @@ -174,7 +174,7 @@ const preprocessors = { if ( isComponent ) { node._state = getChildState( state ); } else { - const name = block.getUniqueName( node.name ); + const name = block.getUniqueName( node.name.replace( /[^a-zA-Z0-9_$]/g, '_' ) ); node._state = getChildState( state, { isTopLevel: false,