-
-
Notifications
You must be signed in to change notification settings - Fork 925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
m.route.param() omits trailing slash on three-dots pattern #2763
Comments
Can confirm this with a test. Thanks for reporting. |
seems like this line causes it. Removing it solves the issue and only results in one failing test which can be solved easily? What do you think @dead-claudia? |
@StephanHoyer Let's hold the fix for v3. The behavior's well-defined as-is: the path has all unnecessary slashes removed, and trailing slashes are considered redundant. Developers may already be relying on the lack of a trailing slash currently, so we should continue to honor it. We should call this out in the docs if it isn't already. Edit: The mismatch is a bug, but we could offer that as a supported escape hatch until v3. |
[skip ci] Release Artifacts for v2.2.0 [skip ci] Move the chat to Zulip (#2771) Release Artifacts for v2.2.1 [skip ci] Fix malformed image tag Turn README images from plain HTML to markdown (#2773) Release Artifacts for v2.2.2 [skip ci] allow trailing slash for routes - fixes #2763 Kick promise polyfill Remove a stale comment This hasn't been true since v2.0 Kick jsonp - fixes #2682 inline obsolete factory Add missing prerelease branch target. Without specifying target:master the prerelease version calculation would be incorrect. implement m.domFor() and use it internally to move and remove nodes. Fix #2780 Address review comments, linter and build concerns Rename dom-for in file paths to domFor Revert "Rename dom-for in file paths to domFor" This reverts commit 5ab2752. Rename dom-for in file paths to domFor Simplify domFor logic
In my project I'm trying to fetch some dynamic path data, so I've decided to store path info as an url parameter. While doing this I've noticed, that
m.route.param(key)
returns value without trailing slash (even if it was provided in the url).That is the example:
So if you navigate to
/#!/list/static/index.css
the output would be correct:But if you navigate to some directory like
/#!/list/static/
the trailing slash in the output would be truncated:I expect
m.route.param("path")
should return"static/"
-- one with trailing slashMithril.js version: [email protected]
Browser and OS:
Same result in latest chrome (v100) and firefox (v91.8)
Context
I've played around and come to some workarounds:
The text was updated successfully, but these errors were encountered: