Router fails to resolve URL-encoded links #1002
Description
Describe the bug
Sapper router fails to route links with URL-encoded characters. That is, links that contain non-ascii characters like 가나다라(hangul).
Logs
GET http://localhost:3000/posts/%ED%85%8C%EC%8A%A4%ED%8A%B8 404 (Not Found)
which translates to http://localhost:3000/posts/테스트 and src/routes/posts/테스트.svelte exists.
To Reproduce
Use any links/routes that would produce a link with encoded characters. The generated code will include the encoded characters.
Expected behavior
The link should resolve according to the url-encoded string.
Stacktraces
No stacktraces were logged
Information about your Sapper Installation:
-
Chrome 78.0.3904.108 (Official Build) (64-bit)
-
macOS 10.14.6 (18G1012)
-
Hosted locally
-
Sapper version 0.27.9
-
Svelte version 3.15.0
-
Ran as dynamic application on dev environment
-
Rollup
Severity
Such URL resolving technique is crucial for international audiences / developers of Sapper based websites.
Additional context
This issue can be simply resolved by adding a url-encoding function to all route related regex tests. I will add a pull request later on.