Skip to content

Conversation

cedric-anne
Copy link
Member

Checklist before requesting a review

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my code.
  • I have added tests that prove my fix is effective or that my feature works.
  • This change requires a documentation update.

Description

Follows #21109.

@cedric-anne cedric-anne self-assigned this Sep 24, 2025
@cedric-anne
Copy link
Member Author

cedric-anne commented Sep 24, 2025

@cconard96 I did not find how I could use lodash functions (_.*) in vue SFC <template>. Since translation functions (__() for instance) are automatically escaping HTML special chars in the JS context, code like :placeholder="__('A > B')" will display A &amp; B due to the escaping made by __() and the second escaping made by vue.

It is too late now to remove the automatic escaping in translation functions (we should have done it when we remove the automatic escaping of dynamic values). I wanted to use _.unescape(), but it may not be the best option. Could you take a look at it ?

@cconard96
Copy link
Contributor

@cconard96 I did not find how I could use lodash functions (_.*) in vue SFC <template>.

I have our translation functions registered as global properties in js/src/vue/app.js to make them available in templates.

@cedric-anne cedric-anne added this to the 11.0.0 milestone Sep 30, 2025
@cedric-anne cedric-anne force-pushed the 11.0/js-escaping-2 branch 3 times, most recently from 8d3f8ad to 4ae6a9c Compare September 30, 2025 14:25
@cedric-anne cedric-anne marked this pull request as ready for review September 30, 2025 14:25
@cedric-anne
Copy link
Member Author

This PR is OK. Tests failure is only related to lack of atoum test classes.

@cedric-anne cedric-anne merged commit daa142c into glpi-project:11.0/bugfixes Oct 1, 2025
24 of 26 checks passed
@cedric-anne cedric-anne deleted the 11.0/js-escaping-2 branch October 1, 2025 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants