Skip to content

Escaping special closing character ] does not work #611

@sahlouls

Description

@sahlouls

In Handlebars, when I needed to escape the ] bracket, I do:
\]
which generally works, but I always get:
com.github.jknack.handlebars.HandlebarsException: inline@12ef18c7:1:257: found: '[Special [case'

fields.[Special [case\]]
.........^

Sample used

<div class="entry">
  <h1>{{ fields.[Special [case\]] }}</h1>
</div>

Context

{
  fields: {
   'Special [case\]': 'yo'
  }
}

Expected output

<div class="entry">
  <h1>yo</h1>
</div>

Checked on http://tryhandlebarsjs.com/

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions