mirror of
				https://github.com/alacritty/alacritty.git
				synced 2025-10-30 23:36:53 -04:00 
			
		
		
		
	Allow URLs to end with trailing slash
This commit is contained in:
		
							parent
							
								
									679b15e274
								
							
						
					
					
						commit
						29c037e3c5
					
				
					 2 changed files with 5 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -45,6 +45,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 | 
			
		|||
- Selections not automatically expanding across double-width characters
 | 
			
		||||
- On macOS, automatic graphics switching has been enabled again
 | 
			
		||||
- Text getting recognized as URLs without slashes separating the scheme
 | 
			
		||||
- URL parser dropping trailing slashes from valid URLs
 | 
			
		||||
 | 
			
		||||
### Removed
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -18,7 +18,7 @@ use crate::term::cell::{Cell, Flags};
 | 
			
		|||
 | 
			
		||||
// See https://tools.ietf.org/html/rfc3987#page-13
 | 
			
		||||
const URL_SEPARATOR_CHARS: [char; 10] = ['<', '>', '"', ' ', '{', '}', '|', '\\', '^', '`'];
 | 
			
		||||
const URL_DENY_END_CHARS: [char; 8] = ['.', ',', ';', ':', '?', '!', '/', '('];
 | 
			
		||||
const URL_DENY_END_CHARS: [char; 7] = ['.', ',', ';', ':', '?', '!', '('];
 | 
			
		||||
const URL_SCHEMES: [&str; 8] =
 | 
			
		||||
    ["http://", "https://", "mailto:", "news:", "file://", "git://", "ssh://", "ftp://"];
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -245,11 +245,11 @@ mod tests {
 | 
			
		|||
        url_test(")https://example.org(", "https://example.org");
 | 
			
		||||
        url_test("https://example.org)", "https://example.org");
 | 
			
		||||
        url_test("https://example.org(", "https://example.org");
 | 
			
		||||
        url_test("(https://one.org/)(https://two.org/)", "https://one.org");
 | 
			
		||||
        url_test("(https://one.org/)(https://two.org/)", "https://one.org/");
 | 
			
		||||
 | 
			
		||||
        url_test("https://[2001:db8:a0b:12f0::1]:80", "https://[2001:db8:a0b:12f0::1]:80");
 | 
			
		||||
        url_test("([(https://example.org/test(ing))])", "https://example.org/test(ing)");
 | 
			
		||||
        url_test("https://example.org/]()", "https://example.org");
 | 
			
		||||
        url_test("https://example.org/]()", "https://example.org/");
 | 
			
		||||
        url_test("[https://example.org]", "https://example.org");
 | 
			
		||||
 | 
			
		||||
        url_test("'https://example.org/test'ing'''", "https://example.org/test'ing'");
 | 
			
		||||
| 
						 | 
				
			
			@ -276,6 +276,7 @@ mod tests {
 | 
			
		|||
        url_test("https://example.org/test?ing", "https://example.org/test?ing");
 | 
			
		||||
        url_test("https://example.org.,;:)'!/?", "https://example.org");
 | 
			
		||||
        url_test("https://example.org'.", "https://example.org");
 | 
			
		||||
        url_test("https://example.org/test/?;:", "https://example.org/test/");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    #[test]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue