diff --git a/Cargo.toml b/Cargo.toml index 8295022..39cf4c6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ repository = "https://github.com/denoland/rust-urlpattern" license = "MIT" [dependencies] -url = "2.4.1" +url = "2.5.6" regex = "1.10.5" serde = { version = "1.0.127", features = ["derive"] } unic-ucd-ident = { version = "0.9.0", features = ["id"] } diff --git a/src/testdata/urlpatterntestdata.json b/src/testdata/urlpatterntestdata.json index 41a400d..202c290 100644 --- a/src/testdata/urlpatterntestdata.json +++ b/src/testdata/urlpatterntestdata.json @@ -2474,7 +2474,6 @@ } }, { - "skip": "likely a bug in rust-url", "pattern": [{ "hostname": "bad\\:hostname" }], "expected_obj": "error" }, diff --git a/src/tokenizer.rs b/src/tokenizer.rs index dd25cfb..b250d9c 100644 --- a/src/tokenizer.rs +++ b/src/tokenizer.rs @@ -160,6 +160,14 @@ pub fn tokenize( ); continue; } + if tokenizer.code_point == Some('\n') + || tokenizer.code_point == Some('\r') + || tokenizer.code_point == Some('\t') + { + // ignore newline, carriage return and tab + tokenizer.index = tokenizer.next_index; + continue; + } if tokenizer.code_point == Some('{') { tokenizer.add_token_with_default_pos_and_len(TokenType::Open); continue;