Remove misleading emoji comment

This commit is contained in:
Charlie Marsh 2023-01-22 21:22:53 -05:00
parent f40ae943a7
commit 07b5bf7030

View file

@ -1,11 +1,12 @@
use once_cell::sync::Lazy; use once_cell::sync::Lazy;
use regex::{Captures, Regex}; use regex::{Captures, Regex};
static CURLY_ESCAPE: Lazy<Regex> = Lazy::new(|| Regex::new(r"(\\N\{[^}]+})|([{}])").unwrap()); static CURLY_BRACES: Lazy<Regex> = Lazy::new(|| Regex::new(r"(\\N\{[^}]+})|([{}])").unwrap());
pub fn curly_escape(text: &str) -> String { pub fn curly_escape(text: &str) -> String {
// We don't support emojis right now. // Match all curly braces. This will include named unicode escapes (like
CURLY_ESCAPE // \N{SNOWMAN}), which we _don't_ want to escape, so take care to preserve them.
CURLY_BRACES
.replace_all(text, |caps: &Captures| { .replace_all(text, |caps: &Captures| {
if let Some(match_) = caps.get(1) { if let Some(match_) = caps.get(1) {
match_.as_str().to_string() match_.as_str().to_string()