Skip to content

Commit

Permalink
remove # char if user inserted it
Browse files Browse the repository at this point in the history
Signed-off-by: kernelkind <[email protected]>
  • Loading branch information
kernelkind committed Feb 6, 2025
1 parent c32a42f commit 0aa7023
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/notedeck_columns/src/ui/add_column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,8 @@ pub fn hashtag_ui(
.add_sized(egui::vec2(50.0, 40.0), add_column_button())
.clicked()
{
let resp = AddColumnOption::Hashtag(text_buffer.to_owned()).take_as_response(ndb, None);
let resp =
AddColumnOption::Hashtag(sanitize_hashtag(text_buffer)).take_as_response(ndb, None);
id_string_map.remove(&id);
resp
} else {
Expand All @@ -786,6 +787,10 @@ pub fn hashtag_ui(
.inner
}

fn sanitize_hashtag(raw_hashtag: &str) -> String {
raw_hashtag.replace("#", "")
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down

0 comments on commit 0aa7023

Please sign in to comment.