HSLdevcom / digitransit-ui

Digitransit UI ("Reittiopas.fi")
https://www.reittiopas.fi/
Other
237 stars 131 forks source link

Broken DepartureRow links as trip URIs are not encoded #4904

Closed hbruch closed 7 months ago

hbruch commented 7 months ago

The Baden-Wuerttemberg GTFS-Feed bwgesamt has tripIds containing hashes, e.g. tub-9-003-1-5-9-H-4-Special#3612-32-64

Expected behaviour:

DepartureRow links to the trips encode these URIs properly.

Observed behavior

DepartureRow does not encode the URI. In consequence the id substring after the hash is dropped and no trip stop list is displayed:

image

Suggestion

The line should read:

<Link to={`/${PREFIX_ROUTES}/${encodeURIComponent(departure.trip.pattern.route.gtfsId)}/${PREFIX_STOPS}/${encodeURIComponent(departure.trip.pattern.code)}/${encodeURIComponent(departure.trip.gtfsId)}`}
vesameskanen commented 7 months ago

fixed.