-
-
Notifications
You must be signed in to change notification settings - Fork 171
fix: Decode HTML entities in climb and area names #1379
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -357,3 +357,24 @@ export const parseUuidAsFirstParam = ({ params }: PageWithCatchAllUuidProps): st | |||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| return uuid | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| export const decodeAmpersand = (s: string): string => { | ||||||||||||||||||||||||||||||
| if (s == null) return '' | ||||||||||||||||||||||||||||||
| return s.replace(/&/g, '&') | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| export const safeDecode = (s: string): string => { | ||||||||||||||||||||||||||||||
| if (s == null) return '' | ||||||||||||||||||||||||||||||
|
Comment on lines
+362
to
+367
|
||||||||||||||||||||||||||||||
| if (s == null) return '' | |
| return s.replace(/&/g, '&') | |
| } | |
| export const safeDecode = (s: string): string => { | |
| if (s == null) return '' | |
| if (s === null || s === undefined) return '' | |
| return s.replace(/&/g, '&') | |
| } | |
| export const safeDecode = (s: string): string => { | |
| if (s === null || s === undefined) return '' |
Copilot
AI
Oct 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use strict equality (===) instead of loose equality (==) for null checks. Replace with explicit null/undefined checks using strict equality for consistency with TypeScript best practices.
| if (s == null) return '' | |
| if (s === null || s === undefined) return '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
decodeAmpersandfunction is exported but never used in the codebase. SincesafeDecodeprovides the same functionality plus additional entity decoding, consider removing this unused export to reduce maintenance burden.