edge-js/edge

Double curly brackets assumed as Mustache braces

Closed this issue · 2 comments

Version:

adonis 4.1.0
node 10.15.1
npm 6.9.0

Recreating steps:

  1. Open Named Route Docs

  2. There is this example:

The same rules apply for the view.

<a href="{{ route('posts.show', { id: 1 }, {query: { foo: 'bar' }}) }}">Show post</a>

// href="/post/1?foo=bar"

  1. Try running it, you'd get error:

InvalidExpressionException E_INVALID_EXPRESSION: Invalid expression < route('posts.show', { id: 1 }, {query: { foo: 'bar' >

  1. Now separate those double curly brackets with one space char:

{query: { foo: 'bar' }} become {query: { foo: 'bar' } }

  1. Re-run, now it works.

Agreed.
This is weird and not intuitive at all.
Even the Synthax Highlighter can handle the double closing braces according.

Furthermore, the querystring isn't set accordingly using this exemple ...

Fixed in v3.0.0. It has breaking changes and will be out by end of the week