@@ -11,7 +11,7 @@ import { isObject } from '@glimmer/util';
11
11
import { ContentType , CurriedType , Op } from '@glimmer/vm' ;
12
12
13
13
import { isCurriedType } from '../../curried-value' ;
14
- import { isEmpty , isFragment , isNode , isSafeString , shouldCoerce } from '../../dom/normalize' ;
14
+ import { isEmpty , isFragment , isNode , isSafeString , isTrustedHTML , shouldCoerce } from '../../dom/normalize' ;
15
15
import { APPEND_OPCODES } from '../../opcodes' ;
16
16
import DynamicTextContent from '../../vm/content/text' ;
17
17
import { CheckReference } from './-debug-strip' ;
@@ -32,6 +32,8 @@ function toContentType(value: unknown) {
32
32
return ContentType . Helper ;
33
33
} else if ( isSafeString ( value ) ) {
34
34
return ContentType . SafeString ;
35
+ } else if ( isTrustedHTML ( value ) ) {
36
+ return ContentType . TrustedHTML ;
35
37
} else if ( isFragment ( value ) ) {
36
38
return ContentType . Fragment ;
37
39
} else if ( isNode ( value ) ) {
@@ -87,7 +89,7 @@ APPEND_OPCODES.add(Op.AppendHTML, (vm) => {
87
89
let reference = check ( vm . stack . pop ( ) , CheckReference ) ;
88
90
89
91
let rawValue = valueForRef ( reference ) ;
90
- let value = isEmpty ( rawValue ) ? '' : String ( rawValue ) ;
92
+ let value = isEmpty ( rawValue ) ? '' : isTrustedHTML ( rawValue ) ? rawValue as string : String ( rawValue ) ;
91
93
92
94
vm . elements ( ) . appendDynamicHTML ( value ) ;
93
95
} ) ;
0 commit comments