fix: urls without slashes not recognized as urls (#336)

This commit is contained in:
Zhong Lufan
2022-10-21 04:32:22 +08:00
committed by GitHub
parent 1c5a061388
commit 2e281b51a2

View File

@@ -738,7 +738,7 @@ end
-- Check if path is a protocol, such as `http://...` -- Check if path is a protocol, such as `http://...`
---@param path string ---@param path string
function is_protocol(path) function is_protocol(path)
return type(path) == 'string' and path:match('^%a[%a%d-_]+://') ~= nil return type(path) == 'string' and (path:match('^%a[%a%d-_]+://') ~= nil or path:match('^%a[%a%d-_]+:\\?') ~= nil)
end end
---@param path string ---@param path string