From 052b3a62a354ba1e9e2141bb73f5c6878043d65f Mon Sep 17 00:00:00 2001 From: Wilfred Hughes Date: Tue, 30 Jan 2024 21:22:12 -0800 Subject: [PATCH] Use XML file headers as language detection hints Fixes #630 --- CHANGELOG.md | 2 ++ src/parse/guess_language.rs | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b34b838b8f..9dac3f9b4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ Added support for Objective-C and VHDL. +Files starting with ` bool { false } +fn looks_like_xml(src: &str) -> bool { + src.starts_with("", &[]), Some(Xml)); + } + #[test] fn test_guess_unknown() { let path = Path::new("jfkdlsjfkdsljfkdsljf");