Skip to content

Commit

Permalink
Allow "ascii" as shorthand for the unicode block "Basic Latin"
Browse files Browse the repository at this point in the history
Since allowing ASCII will be very common (even part of the default
config) it should be simple to refer to.
  • Loading branch information
faern committed Oct 3, 2024
1 parent b00c498 commit 683383f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ impl FromStr for CharacterType {
type Err = InvalidCharacterType;

fn from_str(s: &str) -> Result<Self, Self::Err> {
// 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);
}
Expand Down

0 comments on commit 683383f

Please sign in to comment.