File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
packages/svelte/src/compiler/phases/3-transform/client/visitors Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -229,17 +229,16 @@ export function RegularElement(node, context) {
229
229
( attribute . value === true || is_text_attribute ( attribute ) )
230
230
) {
231
231
const name = get_attribute_name ( node , attribute , context ) ;
232
- const literal_value = /** @type {Literal } */ (
233
- build_attribute_value ( attribute . value , context ) . value
234
- ) . value ;
235
- if ( name !== 'class' || literal_value ) {
232
+ const value = is_text_attribute ( attribute ) ? attribute . value [ 0 ] . data : true ;
233
+
234
+ if ( name !== 'class' || value ) {
236
235
// TODO namespace=foreign probably doesn't want to do template stuff at all and instead use programmatic methods
237
236
// to create the elements it needs.
238
237
context . state . template . push (
239
238
` ${ attribute . name } ${
240
- is_boolean_attribute ( name ) && literal_value === true
239
+ is_boolean_attribute ( name ) && value === true
241
240
? ''
242
- : `="${ literal_value === true ? '' : escape_html ( literal_value , true ) } "`
241
+ : `="${ value === true ? '' : escape_html ( value , true ) } "`
243
242
} `
244
243
) ;
245
244
continue ;
You can’t perform that action at this time.
0 commit comments