alacritty

fork of https://github.com/jwilm/alacritty, experimental
git clone git://git.thc420.xyz/alacritty
Log | Files | Refs | README

commit 29c037e3c5601731b7ec0e9555bd09fe5531bd05
parent 679b15e2749c600950af6dc8386990a5dfedfd0f
Author: Jacob Evan Shreve <jacob@shreve.io>
Date:   Sun, 19 May 2019 15:24:00 -0400

Allow URLs to end with trailing slash


Diffstat:
MCHANGELOG.md | 1+
Malacritty_terminal/src/url.rs | 7++++---
2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md @@ -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 diff --git a/alacritty_terminal/src/url.rs b/alacritty_terminal/src/url.rs @@ -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]