Je réponds ici afin que les autres aient le contexte.
Je trouvais cela étrange car l’onglet de notification n’utilise pas le même chemin de rendu que les autres, alors j’ai annulé localement la nouvelle fonctionnalité d’accès rapide et je peux toujours reproduire le problème :
Je pense qu’il s’agit d’un cas très limite avec notre I18n.t côté client, et voici un test minimal qui échoue à ce sujet : https://github.com/xrav3nz/discourse/commit/3d7324281a285158fe75f9e7b42574906c940e49 .
Corrigé avec :
master ← xrav3nz:fix/i18n-js-edge-case
merged 05:52PM - 16 Sep 19 UTC
> Context: https://meta.discourse.org/t/notification-character-bug/128461/8
I… was almost pulling my hairs out wondering why this would happen, then I took a closer look at [the `replace(pattern, replacement)` function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#Specifying_a_string_as_a_parameter):
> The `replacement` string can include the following special replacement patterns:
>
> Pattern | Inserts
> -- | --
> $& | Inserts the matched substring.
> ... | ...
The dollar sign (`$`) is a special replace pattern, and `$&` inserts the matched string... 😅 Thus dollars signs need to be escaped with the special pattern `$$`, which inserts a single `$`.
Let me know what you think, thanks!
9 « J'aime »