Skip to content

[IMP] runtime/utils: export htmlEscape and add tests #1677

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

Merged
merged 1 commit into from
Mar 26, 2025

Conversation

seb-odoo
Copy link
Contributor

markup tag function requires markup awareness to determine whether a given parameter should be escaped or not.

This implies that pre-escaped content should be properly marked'ed up to avoid double escaping. Having to manually wrap all calls to escape with markup is cumbersome and prone to issues (on top of having to be validated by the security team for no reason).

This commit introduces a markup-aware escape function to resolve those issues.

@seb-odoo seb-odoo force-pushed the master-export-escape--seb branch from 6710049 to 23649ff Compare March 25, 2025 15:53
@ged-odoo
Copy link
Contributor

hmm, it looks like you want to export the htmlescape function to use it out of owl. in that case, you forgot to expose it as an exported value. it should also be exported from here https://github.com/odoo/owl/blob/master/src/runtime/index.ts

markup tag function requires markup awareness to determine whether a
given parameter should be escaped or not.

This implies that pre-escaped content should be properly marked'ed up to
avoid double escaping. Having to manually wrap all calls to escape
with markup is cumbersome and prone to issues (on top of having to be
validated by the security team for no reason).

This commit introduces a markup-aware escape function to resolve those
issues.
@seb-odoo seb-odoo force-pushed the master-export-escape--seb branch from 23649ff to 5547bd7 Compare March 26, 2025 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants