You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@grails.apache.org by "codeconsole (via GitHub)" <gi...@apache.org> on 2025/05/22 22:30:38 UTC
[I] ES6 Literal Template Support inside GSP Pages [grails-core]
codeconsole opened a new issue, #14767:
URL: https://github.com/apache/grails-core/issues/14767
### Expected Behavior
_No response_
### Actual Behaviour
_No response_
### Steps To Reproduce
_No response_
### Environment Information
_No response_
### Example Application
_No response_
### Version
7.0.RC3
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@grails.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] ES6 Literal Template Support inside GSP Pages [grails-core]
Posted by "codeconsole (via GitHub) via notifications" <no...@grails.apache.org>.
codeconsole closed issue #14767: ES6 Literal Template Support inside GSP Pages
URL: https://github.com/apache/grails-core/issues/14767
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] ES6 Literal Template Support inside GSP Pages [grails-core]
Posted by "codeconsole (via GitHub) via notifications" <no...@grails.apache.org>.
codeconsole commented on issue #14767:
URL: https://github.com/apache/grails-core/issues/14767#issuecomment-6881378602
Fixed by #16144 (commit daaa4048b0e78e84418cb9493bbff8ea0eb18324), released in Grails 8.0.0.
A backslash before a GSP expression now escapes it, so `\${...}` renders a literal `${...}` and the expression is not evaluated on the server. The example from this issue becomes:
```html
<script type="text/javascript">
const name = 'Bob';
console.log(`Hello \${name}`)
</script>
```
The browser receives `` `Hello ${name}` `` and JavaScript interpolates it. The `${raw(...)}` workaround is no longer needed. GSP still does not detect template literals inside `<script>` blocks by itself, because `${}` inside a script is also a common way to pass server values into JavaScript. See the "Expressions" section of the GSP Basics guide.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org