Hola a todos (y todas …),
Gladys me informa constantemente (de forma vocal y a través de un bot de Telegram) de mis próximas citas gracias al calendario, y os lo agradezco una vez más, es realmente muy práctico.
Sin embargo, he notado un problema desde hace algún tiempo (no sabría decir exactamente desde cuándo …): en el nombre del evento aparecen los códigos HTML de la puntuación y los caracteres especiales, lo que hace que el texto sea inaudible y menos legible.
¿Sería posible corregirlo?
Os lo agradezco de antemano,
¡Buen final de día,
Jean
Hola @jean_bruder ,
¡Gracias por tu respuesta!
De hecho, todo depende de la fuente del calendario, algunos programas añaden caracteres HTML especiales en los títulos / descripciones.
Tienes razón, podríamos eliminar estos caracteres especiales para que sea más limpio
@bertrandda creo que podríamos modificar calendar.formaters.js para decodificar name, location y description, ¿qué opinas?
Hola,
he mirado rápidamente y creo que he logrado reproducirlo, y quizá me equivoque, pero no creo que el problema sea caldav. Me parece que cada vez que hay una comilla o algún otro carácter especial en una variable « compilada » por la librería Handlebars, la librería escapa el carácter.
Ejemplo (captura de pantalla abajo), cuando miro en la base de datos la comilla está sola, si hago un console.log antes del compile() la comilla también está sola, pero justo después en el resultado, si hago un console.log, añade caracteres adicionales.
He propuesto una PR, dime qué opinas.
master ← bertrandda:fix/escaped-char-variable
ouvert 06:02PM - 25 Jun 26 UTC
### Pull Request check-list
To ensure your Pull Request can be accepted as fa… st as possible, make sure to review and check all of these items:
- [ ] If your changes affect the code, did you write the tests?
- [ ] Are tests passing? (`npm test` on both front/server)
- [ ] Is the linter passing? (`npm run eslint` on both front/server)
- [ ] Did you run prettier? (`npm run prettier` on both front/server)
- [ ] If you are adding a new feature/service, did you run the integration comparator? (`npm run compare-translations` on front)
- [ ] Did you test this pull request in real life? With real devices? If this development is a big feature or a new service, we recommend that you provide a Docker image to the community ([forum](https://community.gladysassistant.com/)) for testing before merging.
- [ ] If your changes modify the API (REST or Node.js), did you modify the API documentation? (Documentation is based on comments in code)
- [ ] If you are adding a new features/services which needs explanation, did you modify the user documentation? See [the GitHub repo](https://github.com/GladysAssistant/v4-website) and the [website](https://gladysassistant.com).
- [ ] Did you add fake requests data for the demo mode (`front/src/config/demo.js`) so that the demo website is working without a backend? (if needed) See [https://demo.gladysassistant.com](https://demo.gladysassistant.com).
NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open.
### Description of change
Please provide a description of the change here. It's always best with screenshots, so don't hesitate to add some!
https://community.gladysassistant.com/t/valeurs-de-calendrier-dans-une-scene-et-caracteres-specaux-accentes/10273/2
## Summary by CodeRabbit
* **Bug Fixes**
* Improved how message text is rendered in several user-facing actions, preserving special characters and formatting in sent messages, AI prompts, voice notifications, and SMS content.
Aquí hay una captura de pantalla (primer mensaje antes del fix, segundo mensaje después del fix)
¡Gracias por investigar, me parece bien!
Por otro lado, creo que puedes extender este comportamiento a los demás lugares afectados, de lo contrario, podríamos encontrar el mismo problema en otro lugar
Aún veo muchos Handlebars.compile en el proyecto.
Y no dudes en añadir una pequeña prueba de paso, así nos aseguramos de que el comportamiento se mantenga estable con el tiempo
@bertrandda en realidad no lo había visto, pero era el caso en tu PR, lo he fusionado, saldrá en la próxima versión de Gladys
pierre-gilles:
@bertrandda en realidad no lo había visto, pero era el caso en tu PR, la he fusionado, saldrá en la próxima versión de Gladys
No, tenías razón, la PR no estaba completa. He añadido el parámetro noescape en los Handlebars.compile restantes. También he añadido una prueba
master ← bertrandda:fix/noescape-handlebar
ouvert 06:27PM - 30 Jun 26 UTC
### Pull Request check-list
To ensure your Pull Request can be accepted as fa… st as possible, make sure to review and check all of these items:
- [ ] If your changes affect the code, did you write the tests?
- [ ] Are tests passing? (`npm test` on both front/server)
- [ ] Is the linter passing? (`npm run eslint` on both front/server)
- [ ] Did you run prettier? (`npm run prettier` on both front/server)
- [ ] If you are adding a new feature/service, did you run the integration comparator? (`npm run compare-translations` on front)
- [ ] Did you test this pull request in real life? With real devices? If this development is a big feature or a new service, we recommend that you provide a Docker image to the community ([forum](https://community.gladysassistant.com/)) for testing before merging.
- [ ] If your changes modify the API (REST or Node.js), did you modify the API documentation? (Documentation is based on comments in code)
- [ ] If you are adding a new features/services which needs explanation, did you modify the user documentation? See [the GitHub repo](https://github.com/GladysAssistant/v4-website) and the [website](https://gladysassistant.com).
- [ ] Did you add fake requests data for the demo mode (`front/src/config/demo.js`) so that the demo website is working without a backend? (if needed) See [https://demo.gladysassistant.com](https://demo.gladysassistant.com).
NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open.
### Description of change
Add `noescape` param for all Handlebars.compile functions to avoid html encoding chars in rendered texts.
Also added a test on one compile with `'`
https://community.gladysassistant.com/t/valeurs-de-calendrier-dans-une-scene-et-caracteres-specaux-accentes/10273/4
## Summary by CodeRabbit
* **Bug Fixes**
* Improved rendering of dynamic text and template-based values so special characters, including apostrophes, are preserved correctly.
* Fixed several scene actions that use generated content, including messages, HTTP requests, delays, conditions, and device values, to display or send text more reliably.
¡Hola @pierre-gilles y @bertrandda
Confirmo que con la versión 4.81.0 que tengo en funcionamiento, la escapada de caracteres especiales está corregida: ¡ya no hay cosas raras enviadas por mensaje y la pronunciación incoherente de los eventos ha desaparecido!
Una vez más, no puedo más que agradeceros
Jean
¡Excelente! En la próxima versión de Gladys vamos a corregir este error en otros lugares, porque no era el único lugar.
Gracias por reportar el error y gracias a @bertrandda por el parche