File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
crates/notedeck_columns/src/ui Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -776,10 +776,10 @@ pub fn hashtag_ui(
776
776
777
777
if handle_user_input && !text_buffer. is_empty ( ) {
778
778
let resp = AddColumnResponse :: Timeline ( TimelineKind :: Hashtag (
779
- sanitize_hashtag ( text_buffer)
779
+ text_buffer
780
780
. split_whitespace ( )
781
781
. filter ( |s| !s. is_empty ( ) )
782
- . map ( |s| s . to_lowercase ( ) . to_string ( ) )
782
+ . map ( |s| sanitize_hashtag ( s ) . to_lowercase ( ) . to_string ( ) )
783
783
. collect :: < Vec < _ > > ( ) ,
784
784
) ) ;
785
785
id_string_map. remove ( & id) ;
@@ -792,7 +792,10 @@ pub fn hashtag_ui(
792
792
}
793
793
794
794
fn sanitize_hashtag ( raw_hashtag : & str ) -> String {
795
- raw_hashtag. replace ( "#" , "" )
795
+ raw_hashtag
796
+ . chars ( )
797
+ . filter ( |c| c. is_alphanumeric ( ) ) // keep letters and numbers only
798
+ . collect ( )
796
799
}
797
800
798
801
#[ cfg( test) ]
You can’t perform that action at this time.
0 commit comments