Skip to content

Conversation

kentor
Copy link
Contributor

@kentor kentor commented Feb 5, 2015

...sh

When a parent route of a child route has an optional trailing slash, the
generated path for the child route will have two slashes in a row. Fix
the trailing slash matcher pattern to account for this case.

This bug occurs when calling Path.injectParams(pattern, params) to
generate a path. The pattern for the path of a child route whose
parent has an optional trailing slash looks something like
parent/?/child. If we just replace /? with / we end up with
parent//child, so we need to replace /?/ with /.

This fixes issue #768.

…slash

When a parent route of a child route has an optional trailing slash, the
generated path for the child route will have two slashes in a row. Fix
the trailing slash matcher pattern to account for this case.

This bug occurs when calling `Path.injectParams(pattern, params)` to
generate a path. The `pattern` for the path of a child route whose
parent has an optional trailing slash looks something like
`parent/?/child`. If we just replace `/?` with `/` we end up with
`parent//child`, so we need to replace `/?/` with `/`.

This fixes issue remix-run#768.
ryanflorence added a commit that referenced this pull request Feb 6, 2015
[fixed] Double slash in href when parent route has optional trailing sla...
@ryanflorence ryanflorence merged commit 19c7bd7 into remix-run:master Feb 6, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants