Skip to content

Alicia Wynona Tjahjadi | Oct2025-1 | Module-Legacy-Code | Sprint-1 | Purple Forest: Bug Report: Hashtag link doesn't work correctly - #3

Open
aliciawt wants to merge 2 commits into
mainfrom
fix/hashtag-link
Open

Alicia Wynona Tjahjadi | Oct2025-1 | Module-Legacy-Code | Sprint-1 | Purple Forest: Bug Report: Hashtag link doesn't work correctly#3
aliciawt wants to merge 2 commits into
mainfrom
fix/hashtag-link

Conversation

@aliciawt

Copy link
Copy Markdown
Owner

Fix: Hashtag link doesn't work correctly

Problem

When clicking on #SwizBiz in Swiz's first bloom ("Let's get some #SwizBiz love!!"), it takes users to an empty page showing #SwizBiz%20love!!. However, clicking the same hashtag in Swiz's second bloom works correctly.

Root Cause

The regex /\B#[^#]+/g in _formatHashtags() was capturing everything after # until the next #, including spaces and punctuation. This resulted in links like /hashtag/SwizBiz%20love!! instead of /hashtag/SwizBiz.

Solution

  • Updated regex from /\B#[^#]+/g to /#(\w+)/g

Testing

  • Clicking #SwizBiz in "Let's get some #SwizBiz love!!" shows blooms
  • Clicking #SwizBiz in "New album dropping at midnight! Pre-save now! #SwizBiz" continues to work
  • Hashtags with underscores work correctly
  • Other hashtags work correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant