Something’s weird here (bad title, please name this properly staff ):
3 Mi Piace
rishabh
13 Settembre 2019, 6:22am
2
Thanks for reporting this! I think this is related to the issue reported on Quick access to bookmarks and messages on user menu . If so, @xrav3nz already has a PR up for it
4 Mi Piace
rishabh:
d to the issue rep
yeah seems like the same bug. please close this dupe
2 Mi Piace
rishabh
13 Settembre 2019, 7:32am
6
Turns out it isn’t the same bug so we’ll need to keep this open. @xrav3nz could repro this and might look into fixing this sometime soon
4 Mi Piace
xrav3nz
13 Settembre 2019, 2:18pm
8
Replying here so that others will have the context.
I thought this was weird because the notification tab does not share the same rendering codepath as the others, so I reverted the new quick access feature locally, and can still repro the issue:
I believe this is a super edge case with our client-side I18n.t, and here is a minimal failing test for it: https://github.com/xrav3nz/discourse/commit/3d7324281a285158fe75f9e7b42574906c940e49 .
Fixed with:
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 Mi Piace