@@ -32,7 +32,7 @@ module.exports = function (Handlebars) {
3232 var parentView = getProperty ( '_view' , this , options ) ;
3333 html = getServerHtml ( viewName , viewOptions , parentView ) ;
3434 } else {
35- html = getClientPlaceholder ( viewName , viewOptions ) ;
35+ html = getClientPlaceholder ( viewName , viewOptions , Handlebars ) ;
3636 }
3737
3838 return new Handlebars . SafeString ( html ) ;
@@ -55,7 +55,7 @@ function getServerHtml(viewName, viewOptions, parentView) {
5555 return view . getHtml ( ) ;
5656}
5757
58- function getClientPlaceholder ( viewName , viewOptions ) {
58+ function getClientPlaceholder ( viewName , viewOptions , Handlebars ) {
5959 if ( ! BaseView ) { BaseView = require ( 'rendr/shared/base/view' ) ; }
6060 var fetchSummary ;
6161
@@ -67,7 +67,13 @@ function getClientPlaceholder(viewName, viewOptions) {
6767
6868 // create a list of data attributes
6969 var attrString = _ . inject ( viewOptions , function ( memo , value , key ) {
70- if ( _ . isArray ( value ) || _ . isObject ( value ) ) { value = JSON . stringify ( value ) ; }
70+ if ( _ . isArray ( value ) || _ . isObject ( value ) ) {
71+ if ( key === '_block' && value instanceof Handlebars . SafeString ) {
72+ value = value . string ;
73+ } else {
74+ value = JSON . stringify ( value ) ;
75+ }
76+ }
7177 return memo += " data-" + key + "=\"" + _ . escape ( value ) + "\"" ;
7278 } , '' ) ;
7379
0 commit comments