File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
test/integration/builtin/tags Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -14,12 +14,18 @@ export default {
14
14
render : function * ( ctx : Context , emitter : Emitter ) {
15
15
const { liquid, hash, file } = this
16
16
const { renderer } = liquid
17
+ if ( file . getText ( ) === 'none' ) {
18
+ ctx . setRegister ( 'blockMode' , BlockMode . OUTPUT )
19
+ const html = yield renderer . renderTemplates ( this . tpls , ctx )
20
+ emitter . write ( html )
21
+ return
22
+ }
17
23
const filepath = ctx . opts . dynamicPartials
18
24
? ( TypeGuards . isQuotedToken ( file )
19
25
? yield renderer . renderTemplates ( liquid . parse ( evalQuotedToken ( file ) ) , ctx )
20
26
: evalToken ( this . file , ctx ) )
21
27
: file . getText ( )
22
- assert ( filepath , ( ) => `illegal filename "${ file . getText ( ) } ": "${ filepath } "` )
28
+ assert ( filepath , ( ) => `file "${ file . getText ( ) } "( "${ filepath } ") not available ` )
23
29
const templates = yield liquid . _parseFile ( filepath , ctx . opts , ctx . sync )
24
30
25
31
// render remaining contents and store rendered results
Original file line number Diff line number Diff line change @@ -38,9 +38,16 @@ describe('tags/layout', function () {
38
38
} )
39
39
return liquid . renderFile ( '/parent.html' ) . catch ( function ( e ) {
40
40
expect ( e . name ) . to . equal ( 'RenderError' )
41
- expect ( e . message ) . to . match ( / i l l e g a l f i l e n a m e " f o o " : " u n d e f i n e d " / )
41
+ expect ( e . message ) . to . contain ( 'file "foo"( "undefined") not available' )
42
42
} )
43
43
} )
44
+ it ( 'should handle layout none' , async function ( ) {
45
+ const src = '{% layout none %}' +
46
+ '{%block a%}A{%endblock%}' +
47
+ 'B'
48
+ const html = await liquid . parseAndRender ( src )
49
+ return expect ( html ) . to . equal ( 'AB' )
50
+ } )
44
51
describe ( 'anonymous block' , function ( ) {
45
52
it ( 'should handle anonymous block' , async function ( ) {
46
53
mock ( {
You can’t perform that action at this time.
0 commit comments