-
Notifications
You must be signed in to change notification settings - Fork 378
[IMP] runtime: add markup tag function #1670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
399e5d2
to
c06be40
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's see what @jum-odoo thinks.
c6015d6
to
aa1db2d
Compare
aa1db2d
to
e754f3d
Compare
Allows markup to be called as a tag function. The interpolated strings are then safely escaped for injection in HTML code. Example usage: ```js const maliciousInput = "<script>alert('💥💥')</script>"; const value = markup`<b>${maliciousInput}</b>`; // no problem, maliciousInput is properly escaped ```
e754f3d
to
80d882a
Compare
markup-aware escape should be exported so we can use it in Odoo in place of See odoo/odoo#199300 for a proof of concept in Odoo of this PR. |
Thank you for accepting it, it is a nice improvement! I still wish |
we need to do something about markup and eventbus at least. Ideally, it should be accessible in some parts of odoo without the need for owl, for example, the website. there is a task for that though https://www.odoo.com/odoo/project/133/tasks/4364029?debug=assets |
Should we start re-exporting |
Export of the escape function + tests: #1677 I still think it has value until a proper solution to the above-mentioned task is found. Feel free to discard the PR, as we already have this function inside Odoo, it's not really "blocking". |
And a final request on this matter, would it be possible to make a release with the current PR (and the escape one, if it is approved) one of these days? 🙏 I'd love to start using the new syntax in Odoo whenever possible! We do have quite a few markup-sensitive PR in the way (especially the composer one), and I'd like to rebase and finish odoo/odoo#199300 too. |
Allows markup to be called as a tag function. The interpolated strings are then safely escaped for injection in HTML code.
Example usage: