[WIP] Try to fix tabled panic (#14710)

cc: @fdncred
This commit is contained in:
Maxim Zhiburt 2025-01-01 17:09:23 +03:00 committed by GitHub
parent 76afa74320
commit c6523eb8d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -55,27 +55,25 @@ pub fn clean_charset(text: &str) -> String {
// We could shrink it but...it will be another realloc which make no scense.
let mut buf = String::with_capacity(text.len());
// note: (Left just in case)
// note: This check could be added in order to cope with emojie issue.
// if c < ' ' && c != '\u{1b}' {
// continue;
// }
for c in text.chars() {
if c == '\n' {
buf.push(c);
continue;
match c {
'\r' => continue,
'\t' => {
buf.push(' ');
buf.push(' ');
buf.push(' ');
buf.push(' ');
}
c => {
buf.push(c);
}
}
if c == '\t' {
buf.push(' ');
buf.push(' ');
buf.push(' ');
buf.push(' ');
continue;
}
// note: Overall maybe we shall delete this check?
// it was made in order to cope with emojie issue.
// if c < ' ' && c != '\u{1b}' {
// continue;
// }
buf.push(c);
}
buf