Merge pull request #1259

# Conflicts:
#	crates/engine/src/cmd/richclip.rs
This commit is contained in:
Brandon Thomas
2026-10-25 13:42:29 -04:00
+7 -1
View File
@@ -350,7 +350,7 @@ fn numeric_char(digits: &str) -> Option<char> {
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("a&#65;b&#x41;"), "aAbA");
}
#[test]
fn numeric_tab_entity_decodes_to_tab() {
assert_eq!(decode_text("a&#9;b"), "a\tb");
assert_eq!(decode_text("a&#x9;b"), "a\tb");
}
#[test]
fn google_docs_normal_weight_wrapper_is_not_bold() {
let html = "<meta charset=\"utf-8\"><b style=\"font-weight:normal;\" id=\"docs-internal-guid-1\"><span style=\"font-weight:400\">plain words</span></b>";