From 683383f1052ef9417e87124296822236eb9f0c36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20F=C3=A4rnstrand?= Date: Thu, 3 Oct 2024 15:54:09 +0200 Subject: [PATCH] Allow "ascii" as shorthand for the unicode block "Basic Latin" Since allowing ASCII will be very common (even part of the default config) it should be simple to refer to. --- src/config.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/config.rs b/src/config.rs index 5f11986..910506f 100644 --- a/src/config.rs +++ b/src/config.rs @@ -29,6 +29,10 @@ impl FromStr for CharacterType { type Err = InvalidCharacterType; fn from_str(s: &str) -> Result { + // Shorthand to the ascii unicode block + if s == "ascii" { + return Ok(Self::Block(&crate::unicode_blocks::BASIC_LATIN)); + } if s == "bidi" { return Ok(Self::Bidi); }