diff --git a/crates/notedeck_columns/src/post.rs b/crates/notedeck_columns/src/post.rs index e99cc21..1943278 100644 --- a/crates/notedeck_columns/src/post.rs +++ b/crates/notedeck_columns/src/post.rs @@ -132,7 +132,7 @@ impl NewPost { for word in content.split_whitespace() { if word.starts_with('#') && word.len() > 1 { let tag = word[1..] - .trim_end_matches(|c: char| !c.is_alphanumeric()) + .trim_end_matches(|c: char| c.is_ascii_punctuation()) .to_lowercase(); if !tag.is_empty() { hashtags.insert(tag); @@ -155,9 +155,8 @@ mod tests { ("No hashtags here", vec![]), ("#tag1 with #tag2!", vec!["tag1", "tag2"]), ("Ignore # empty", vec![]), - ("Keep #alphanumeric123", vec!["alphanumeric123"]), - ("Testing emoji #๐ŸŒsfd", vec!["๐ŸŒsfd"]), - ("Testing emoji with space #๐ŸŒ sfd", vec!["๐ŸŒ"]), + ("Testing emoji #๐ŸŒbanana", vec!["๐ŸŒbanana"]), + ("Testing emoji #๐ŸŒ", vec!["๐ŸŒ"]), ("Duplicate #tag #tag #tag", vec!["tag"]), ("Mixed case #TaG #tag #TAG", vec!["tag"]), (