apache / apache/grails-core

ES6 Literal Template Support inside GSP Pages

Open
#14,767 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Groovy
Stars
2.9k
Forks
975
Avg merge
1d 22h
Merged PRs (30d)
92

Description

The following will not work inside a gsp and will throw an exception.
```html

const name = 'Bob';
console.log(`Hello ${name}`)

```

Workaround:
```html

const name = 'Bob';
console.log(${raw('`Hello ${name}`')})

```

but a workaround shouldn't be necessary if 1. currently in a block AND inside ``.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the example in a GSP page containing a script block and an ES6 template literal, then inspect the GSP template parsing path. Done means the literal works inside script blocks without requiring the raw() workaround; no specific source file or test is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy, javascript
Domain
web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.