kabukky / journey

A blog engine written in Go, compatible with Ghost themes.
https://kabukky.github.io/journey
MIT License
1.98k stars 202 forks source link

Nested helpers in .hbs not supported. #117

Open ofauchon opened 4 years ago

ofauchon commented 4 years ago

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

assistcontrol commented 4 years ago

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.

ofauchon commented 4 years ago

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

Thanks