sanitize index values

This commit is contained in:
yggverse 2025-07-09 01:37:37 +03:00
parent b22695587d
commit d0d469ee78
2 changed files with 8 additions and 1 deletions

View file

@ -35,9 +35,15 @@ impl Value {
fn filter_name(value: Option<String>) -> Option<String> {
value.map(|v| {
if v.len() > NAME_MAX_LEN {
format!("{}...", &v[..NAME_MAX_LEN])
format!("{}...", sanitize(&v[..NAME_MAX_LEN]))
} else {
v
}
})
}
/// Strip tags & bom chars from string
fn sanitize(value: &str) -> String {
use voca_rs::strip::*;
strip_tags(&strip_bom(value))
}