Fix mentions not being stopped by >

This commit is contained in:
Joscha 2023-01-30 17:59:46 +01:00
parent b6d69ce0b5
commit 56373135c7
2 changed files with 5 additions and 1 deletions

View file

@ -21,6 +21,9 @@ Procedure when bumping the version number:
- Respect colon-delimited emoji when calculating nick hue - Respect colon-delimited emoji when calculating nick hue
- Display colon-delimited emoji in nicks and messages - Display colon-delimited emoji in nicks and messages
### Fixed
- Mentions not being stopped by `>`
## v0.5.2 - 2023-01-14 ## v0.5.2 - 2023-01-14
### Added ### Added

View file

@ -13,8 +13,9 @@ use super::util;
fn nick_char(ch: char) -> bool { fn nick_char(ch: char) -> bool {
// Closely following the heim mention regex: // Closely following the heim mention regex:
// https://github.com/euphoria-io/heim/blob/978c921063e6b06012fc8d16d9fbf1b3a0be1191/client/lib/stores/chat.js#L14-L15 // https://github.com/euphoria-io/heim/blob/978c921063e6b06012fc8d16d9fbf1b3a0be1191/client/lib/stores/chat.js#L14-L15
// `>` has been experimentally confirmed to delimit mentions as well.
match ch { match ch {
',' | '.' | '!' | '?' | ';' | '&' | '<' | '\'' | '"' => false, ',' | '.' | '!' | '?' | ';' | '&' | '<' | '>' | '\'' | '"' => false,
_ => !ch.is_whitespace(), _ => !ch.is_whitespace(),
} }
} }