0.1.1: ignore if first letter is non-alphabetic
This commit is contained in:
		
							parent
							
								
									e6de23992f
								
							
						
					
					
						commit
						4be4032055
					
				
					 2 changed files with 10 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
[package]
 | 
			
		||||
name = "schmfy"
 | 
			
		||||
version = "0.1.0"
 | 
			
		||||
version = "0.1.1"
 | 
			
		||||
edition = "2021"
 | 
			
		||||
license = "MIT OR Apache-2.0"
 | 
			
		||||
description = "Schmfication library"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,6 +4,15 @@ pub fn schmfy(source: String) -> String {
 | 
			
		|||
        return source;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if source.len() == 0 {
 | 
			
		||||
        return source;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // can't be empty
 | 
			
		||||
    if !source.chars().next().unwrap().is_alphabetic() {
 | 
			
		||||
        return source;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // if source is subsite (e.g. news/fsr), schmfy all parts separately
 | 
			
		||||
    if source.contains('/') {
 | 
			
		||||
        return source
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue