Calendar values in a scene and special/accented characters

Hello everyone (and everyone else…),

Hi @jean_bruder,

Thanks for your feedback!

Actually, it all depends on the calendar source, some tools add special HTML characters in the titles/descriptions.

You’re right, we could remove these special characters to make it cleaner :slight_smile:

@bertrandda I think we could modify calendar.formaters.js to decode name, location and description, what do you think?

Hi,
I took a quick look and I think I managed to reproduce the issue. Maybe I’m wrong, but I don’t think the problem is with Caldav. It seems that whenever an apostrophe or other special character is in a variable « compiled » by the Handlebars library, the library escapes the character.

Example (screenshot below), when I look in the database the apostrophe is alone, if I console.log before the compile() the apostrophe is alone as well, but right after in the result if I console.log it adds extra characters.

I proposed a PR, let me know what you think.

Here is a screenshot (first message before the fix, second message after the fix)

Thanks for investigating, that looks good to me!

However, I think you can extend this behavior to the other affected areas, otherwise we might encounter the same issue elsewhere :grinning_face_with_smiling_eyes:

I still see quite a few Handlebars.compile instances in the project.

And don’t hesitate to add a small test along the way, that way we ensure the behavior remains stable over time :wink:

@bertrandda actually I hadn’t noticed, but it was indeed the case in your PR, I’ve merged it, it will be in the next version of Gladys :slight_smile:

The fix is available in Gladys Assistant 4.81:

No, you were right, the PR wasn’t complete. I added the noescape parameter in the remaining Handlebars.compile calls. I also added a test

Hello @pierre-gilles and @bertrandda :slight_smile:

I can confirm that with version 4.81.0 running on my system, the escaping of special characters is fixed: no more strange things sent in messages and inconsistent event pronunciation now!

Once again, I can only thank you :heart:

Jean

Excellent! In the next version of Gladys, we’ll fix this bug in other places because it wasn’t the only one.

Thanks for reporting the bug and thanks to @bertrandda for the fix :blush: