diff --git a/crates/engine/src/cmd/richclip.rs b/crates/engine/src/cmd/richclip.rs index a3811911..5b9eaf6d 100644 --- a/crates/engine/src/cmd/richclip.rs +++ b/crates/engine/src/cmd/richclip.rs @@ -350,7 +350,7 @@ fn numeric_char(digits: &str) -> Option { return None; } let n = u32::from_str_radix(body, radix).ok()?; - char::from_u32(n).filter(|c| !c.is_control() || *c == '\n') + char::from_u32(n).filter(|c| !c.is_control() || matches!(*c, '\n' | '\t')) } /// Do the HTML's words and the paste's plain text say the same thing? @@ -383,6 +383,12 @@ mod tests { assert_eq!(decode_text("aAbA"), "aAbA"); } + #[test] + fn numeric_tab_entity_decodes_to_tab() { + assert_eq!(decode_text("a b"), "a\tb"); + assert_eq!(decode_text("a b"), "a\tb"); + } + #[test] fn google_docs_normal_weight_wrapper_is_not_bold() { let html = "plain words";