Skip to content

Manchester | 25-SDC-Nov | Rahwa Haile | Sprint 1 | Bug Report: Hashtag link doesn't work correctly#144

Open
RahwaZeslusHaile wants to merge 3 commits intoCodeYourFuture:mainfrom
RahwaZeslusHaile:hashtag-link
Open

Manchester | 25-SDC-Nov | Rahwa Haile | Sprint 1 | Bug Report: Hashtag link doesn't work correctly#144
RahwaZeslusHaile wants to merge 3 commits intoCodeYourFuture:mainfrom
RahwaZeslusHaile:hashtag-link

Conversation

@RahwaZeslusHaile
Copy link

Manchester | 25-SDC-Nov | Rahwa Haile | Sprint 1 | Bug Report: Hashtag link doesn't work correctly

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Fix: Hashtag Links Not Working Properly

Description

This PR fixes an issue where hashtag links in blooms weren't working consistently. Specifically, clicking on hashtags like #SwizBiz in some blooms would take you to an empty hashtag page with no results, while clicking the same hashtag in other blooms would work correctly.

Root Cause

The hashtag regex in the frontend was using /\B#[^#]+/g, which has issues with word boundaries and special characters. This caused inconsistent hashtag link generation depending on the context in which the hashtag appeared.

Changes

  • front-end/components/bloom.mjs: Updated hashtag regex from /\B#[^#]+/g to /#\w+/g
    • The new pattern correctly matches hashtags starting with # followed by word characters
    • This ensures consistent hashtag link generation across all blooms
  • db/schema.sql: Added DROP TABLE statements to safely recreate tables during schema initialization

How to Test

  1. Load the populated data with Swiz's blooms
  2. Click on #SwizBiz in "Let's get some #SwizBiz love!!"
  3. Verify it now shows the hashtag page with blooms containing #SwizBiz (previously showed empty page)
  4. Click on #SwizBiz in other blooms and verify consistent behavior

Related Issue

Resolves weird hashtag link behavior where the same hashtag would work in some blooms but not others.

Please review my work — thank you!

@RahwaZeslusHaile RahwaZeslusHaile added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed.

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant