diff --git a/lua/gx/handlers/url.lua b/lua/gx/handlers/url.lua index 6fc3c53..5381574 100644 --- a/lua/gx/handlers/url.lua +++ b/lua/gx/handlers/url.lua @@ -10,7 +10,7 @@ local M = { -- get url from line (with http/s) function M.handle(mode, line, _) - local pattern = "(https?://[a-zA-Z%d_/%%%-%.~@\\+#=?&:]+)" + local pattern = "(https?://[a-zA-Z%d_/%%%-%.~@\\+#=?&:*]+)" local url = helper.find(line, mode, pattern) -- match url without http(s) diff --git a/test/spec/gx/handlers/url_spec.lua b/test/spec/gx/handlers/url_spec.lua index 0f44598..04b321d 100644 --- a/test/spec/gx/handlers/url_spec.lua +++ b/test/spec/gx/handlers/url_spec.lua @@ -44,6 +44,10 @@ describe("url_parser_does_work", function() "https://golang-jwt.github.io/jwt/usage/signing\\_methods/#signing-methods-and-key-types" ) ) + assert.equals( + "https://crontab.guru/#0_3_*_*_*", + handler.handle("n", "https://crontab.guru/#0_3_*_*_*") + ) end) it("urls in python", function()