@@ -611,9 +611,15 @@ const javascript_visitors_runes = {
611
611
* @param {true | Array<import('#compiler').Text | import('#compiler').ExpressionTag> } attribute_value
612
612
* @param {import('./types').ComponentContext } context
613
613
* @param {boolean } trim_whitespace
614
+ * @param {boolean } is_component
614
615
* @returns {import('estree').Expression }
615
616
*/
616
- function serialize_attribute_value ( attribute_value , context , trim_whitespace = false ) {
617
+ function serialize_attribute_value (
618
+ attribute_value ,
619
+ context ,
620
+ trim_whitespace = false ,
621
+ is_component = false
622
+ ) {
617
623
if ( attribute_value === true ) {
618
624
return b . true ;
619
625
}
@@ -629,7 +635,8 @@ function serialize_attribute_value(attribute_value, context, trim_whitespace = f
629
635
if ( trim_whitespace ) {
630
636
data = data . replace ( regex_whitespaces_strict , ' ' ) . trim ( ) ;
631
637
}
632
- return b . literal ( escape_html ( data , true ) ) ;
638
+
639
+ return b . literal ( is_component ? data : escape_html ( data , true ) ) ;
633
640
} else {
634
641
return /** @type {import('estree').Expression } */ ( context . visit ( value . expression ) ) ;
635
642
}
@@ -777,12 +784,12 @@ function serialize_inline_component(node, component_name, context) {
777
784
} else if ( attribute . type === 'Attribute' ) {
778
785
if ( attribute . name === 'slot' ) continue ;
779
786
if ( attribute . name . startsWith ( '--' ) ) {
780
- const value = serialize_attribute_value ( attribute . value , context ) ;
787
+ const value = serialize_attribute_value ( attribute . value , context , false , true ) ;
781
788
custom_css_props . push ( b . init ( attribute . name , value ) ) ;
782
789
continue ;
783
790
}
784
791
785
- const value = serialize_attribute_value ( attribute . value , context ) ;
792
+ const value = serialize_attribute_value ( attribute . value , context , false , true ) ;
786
793
push_prop ( b . prop ( 'init' , b . key ( attribute . name ) , value ) ) ;
787
794
} else if ( attribute . type === 'BindDirective' ) {
788
795
// TODO this needs to turn the whole thing into a while loop because the binding could be mutated eagerly in the child
0 commit comments