@@ -357,6 +357,7 @@ CompilerProto.compileTextNode = function (node) {
357
357
358
358
for ( var i = 0 , l = tokens . length ; i < l ; i ++ ) {
359
359
token = tokens [ i ]
360
+ directive = null
360
361
if ( token . key ) { // a binding
361
362
if ( token . key . charAt ( 0 ) === '>' ) { // a partial
362
363
partialId = token . key . slice ( 1 ) . trim ( )
@@ -368,14 +369,12 @@ CompilerProto.compileTextNode = function (node) {
368
369
partialNodes = slice . call ( el . childNodes )
369
370
}
370
371
} else { // a real binding
371
- if ( ! token . html ) // text binding
372
+ if ( ! token . html ) { // text binding
372
373
el = document . createTextNode ( '' )
373
374
directive = Directive . parse ( 'text' , token . key , this , el )
374
- if ( directive ) {
375
- this . bindDirective ( directive )
376
- }
377
375
} else { // html binding
378
-
376
+ el = document . createComment ( config . prefix + '-html' )
377
+ directive = Directive . parse ( 'html' , token . key , this , el )
379
378
}
380
379
}
381
380
} else { // a plain string
@@ -384,6 +383,9 @@ CompilerProto.compileTextNode = function (node) {
384
383
385
384
// insert node
386
385
node . parentNode . insertBefore ( el , node )
386
+ if ( directive ) {
387
+ this . bindDirective ( directive )
388
+ }
387
389
388
390
// compile partial after appending, because its children's parentNode
389
391
// will change from the fragment to the correct parentNode.
0 commit comments