File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed
Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -237,6 +237,9 @@ ExpressHbs.prototype.express3 = function(options) {
237237 if ( val === undefined && typeof options . fn === 'function' ) {
238238 val = options . fn ( this ) ;
239239 }
240+ if ( Array . isArray ( val ) ) {
241+ val = val . join ( '\n' ) ;
242+ }
240243 return val ;
241244 } ) ;
242245
Original file line number Diff line number Diff line change @@ -429,3 +429,20 @@ describe('issue-144', function() {
429429 } ) ;
430430 } ) ;
431431} ) ;
432+
433+ describe ( 'issue-153' , function ( ) {
434+ var dirname = path . join ( __dirname , 'issues/153' ) ;
435+ it ( 'should concat contentFor blocks with newline' , function ( done ) {
436+ var check = function ( err , html ) {
437+ if ( err ) {
438+ done ( err ) ;
439+ }
440+ assert . equal ( '1\n2' , html . trim ( ) ) ;
441+ done ( ) ;
442+ }
443+ var hb = hbs . create ( )
444+ var render = hb . express3 ( { } ) ;
445+ var locals = H . createLocals ( 'express3' , dirname , { } ) ;
446+ render ( dirname + '/index.hbs' , locals , check ) ;
447+ } ) ;
448+ } ) ;
Original file line number Diff line number Diff line change 1+ {{ #contentFor " testBlock" }} 1{{ /contentFor }}
2+ {{ #contentFor " testBlock" }} 2{{ /contentFor }}
3+ {{{ block " testBlock" }}}
You can’t perform that action at this time.
0 commit comments