Skip to content

Conversation

@DHANUSHRAJA22
Copy link
Contributor

Summary

This pull request fixes the bug reported in issue #5239 where labels containing spaces cause broken GitHub URLs in both the website interface and API requests.

Changes Made

1. Fixed API Requests (javascripts/fetchIssueCount.js)

  • Added proper URL encoding for labels with spaces when making GitHub API calls
  • Labels containing spaces are now wrapped in double quotes before URL encoding
  • This follows GitHub's API requirements for labels with special characters

2. Fixed Page Links (_includes/scripts.html)

  • Updated the template to properly encode label URLs in the project display
  • Added JavaScript logic to detect labels with spaces and encode them correctly
  • Replaced direct URL generation with proper encoding logic

Technical Details

Before: Labels like "good first issue" would generate malformed URLs:

  • API: https://api.github.com/repos/owner/repo/issues?labels=good first issue
  • Page: https://github.com/owner/repo/labels/good first issue

After: Labels are properly encoded:

  • API: https://api.github.com/repos/owner/repo/issues?labels="good%20first%20issue"
  • Page: https://github.com/owner/repo/labels/good%20first%20issue

Testing

Tested with projects that have labels containing spaces to ensure:

  • ✅ GitHub API requests work correctly
  • ✅ Label links navigate to the correct GitHub pages
  • ✅ Issue counts are fetched accurately
  • ✅ No breaking changes for labels without spaces

Fixes #5239

…encoding for labels with spaces in fetchIssueCount.jsUpdate fetchIssueCount.js

Wrap labels containing spaces in double quotes before URL encoding to prevent API request failures. This fixes issue where labels with spaces (like 'good first issue') would not work properly when fetching issue counts from the GitHub API.
…or labels with spaces in templateUpdate scripts.html

Updated the HTML template to properly encode GitHub label URLs when labels contain spaces by wrapping them in double quotes before URL encoding. This fixes the bug where labels with spaces would result in broken links to GitHub issues pages. The fix mirrors the same encoding logic that was already applied in fetchIssueCount.js.
@netlify
Copy link

netlify bot commented Aug 26, 2025

Deploy Preview for up-for-grabs-test-bench ready!

Name Link
🔨 Latest commit e69a710
🔍 Latest deploy log https://app.netlify.com/projects/up-for-grabs-test-bench/deploys/68ae295868440400084a3718
😎 Deploy Preview https://deploy-preview-5338--up-for-grabs-test-bench.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@shiftbot
Copy link
Contributor

👋 I'm a robot checking the state of this pull request to save the human reviewers time. I don't see any changes under _data/projects/ so I don't have any feedback here.

As you make changes to this pull request, I'll re-run these checks.

…-for-grabs#912)Improve accessibility: fix heading hierarchy in before.html (Fixes up-for-grabs#912)Update before.html

- Changed h1 to h2 for proper heading hierarchy
- Added h3 for subsection heading
- Added semantic section with aria-labelledby
- Changed ul to ol for numbered steps
- Added explicit role='list' for better screen reader support
…bs#912)Update index.html

- Added proper semantic structure with main element
- Added aria-labelledby attributes for better screen reader support
- Added role='region' and aria-label for projects panel
- Improved heading structure and navigation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants