fix: replace escape characters with caret symbol in code previewer

This commit is contained in:
Xerxes-2 2024-08-02 17:54:11 +10:00
parent 5ea20229fb
commit e9e1da115d
No known key found for this signature in database
GPG key ID: A6C508165D76B601

View file

@ -84,11 +84,7 @@ impl Highlighter {
buf.push(b'\n');
}
buf.iter_mut().for_each(|b| {
if *b == 27 {
*b = b' '
}
});
buf.iter_mut().filter(|&&mut b| b == b'\x1b').for_each(|b| *b = b'^');
if i > skip {
after.push(String::from_utf8_lossy(&buf).into_owned());