@@ -357,6 +357,7 @@ CompilerProto.compileTextNode = function (node) {
357357
358358 for ( var i = 0 , l = tokens . length ; i < l ; i ++ ) {
359359 token = tokens [ i ]
360+ directive = null
360361 if ( token . key ) { // a binding
361362 if ( token . key . charAt ( 0 ) === '>' ) { // a partial
362363 partialId = token . key . slice ( 1 ) . trim ( )
@@ -368,14 +369,12 @@ CompilerProto.compileTextNode = function (node) {
368369 partialNodes = slice . call ( el . childNodes )
369370 }
370371 } else { // a real binding
371- if ( ! token . html ) // text binding
372+ if ( ! token . html ) { // text binding
372373 el = document . createTextNode ( '' )
373374 directive = Directive . parse ( 'text' , token . key , this , el )
374- if ( directive ) {
375- this . bindDirective ( directive )
376- }
377375 } else { // html binding
378-
376+ el = document . createComment ( config . prefix + '-html' )
377+ directive = Directive . parse ( 'html' , token . key , this , el )
379378 }
380379 }
381380 } else { // a plain string
@@ -384,6 +383,9 @@ CompilerProto.compileTextNode = function (node) {
384383
385384 // insert node
386385 node . parentNode . insertBefore ( el , node )
386+ if ( directive ) {
387+ this . bindDirective ( directive )
388+ }
387389
388390 // compile partial after appending, because its children's parentNode
389391 // will change from the fragment to the correct parentNode.
0 commit comments