Added dashes (-) to allowed topics
This commit is contained in:
@ -18,7 +18,7 @@ fn emoji_map() -> &'static HashMap<String, String> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn validate_topic(topic: &str) -> Result<&str, Error> {
|
pub fn validate_topic(topic: &str) -> Result<&str, Error> {
|
||||||
let re = Regex::new(r"^\w+$").unwrap();
|
let re = Regex::new(r"^[\w\-]+$").unwrap();
|
||||||
if re.is_match(topic) {
|
if re.is_match(topic) {
|
||||||
Ok(topic)
|
Ok(topic)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user