journey icon indicating copy to clipboard operation
journey copied to clipboard

Nested helpers in .hbs not supported.

Open ofauchon opened this issue 4 years ago • 2 comments

While testing journey with 'paperleaf' theme, I found out that "Nested Helpers" are not working properly in comments like :

{{!-- jQuery needs to come before `{{ghost_foot}}` so that jQuery can be used in code injection --}}

It fires the following error: :

#### compileTemplateFromFile( /home/x/go/src/github.com/kabukky/journey/content/themes/paperleaf/default.hbs )
#### compileTemplate(name: default )
panic: runtime error: slice bounds out of range [855:774]

goroutine 1 [running]:
github.com/kabukky/journey/templates.findHelper(0xc000168500, 0x4d3, 0x4d3, 0xc0000f8800, 0x8, 0x8, 0xc000168500, 0x4d3, 0x4d3, 0x0, ...)
        /home/x/go/src/github.com/kabukky/journey/templates/generation.go:97 +0xb24

In this case, the faulty line is only a comment, so deleting it for the.hbs solves the problem.

Olivier

ofauchon avatar Oct 16 '19 20:10 ofauchon

The Casper theme also causes this panic. If fixing this bug isn't a priority, perhaps the docs should be updated not to recommend installing Casper.

assistcontrol avatar Sep 03 '20 07:09 assistcontrol

Hi. Is the project still maintained and alive ? I can't see much commits in the past day/month

Thanks

ofauchon avatar Sep 03 '20 12:09 ofauchon