Skip to content

Conversation

@AliQassab
Copy link

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 Parsing Issue

Problem: Hashtag links with spaces or punctuation were creating broken URLs and showing empty pages.

Example: Clicking #SwizBiz in "Let's get some #SwizBiz love!!" created URL /hashtag/SwizBiz love!! which showed no blooms.

Solution: Updated hashtag regex from /\B#[^#]+/g to /\B#\w+/g to only capture valid hashtag characters (letters, numbers, underscores).

Result: All #SwizBiz hashtags now correctly navigate to /hashtag/SwizBiz and show all related blooms.

Files Changed:

  • front-end/components/bloom.mjs - Updated _formatHashtags() function

@AliQassab AliQassab added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 16, 2025
Copy link

@mjpeet mjpeet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great solution, keep up the good work!

return text.replace(
/\B#[^#]+/g,
/\B#\w+/g,
// /\B#[^#]+/g,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

usually we don't leave comments like this in the code (this is why git is there - to track changes)

if (!text) return text;
return text.replace(
/\B#[^#]+/g,
/\B#\w+/g,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great work for fixing this bug! The solution is precise, well-reasoned, and demonstrates solid understanding of regex patterns and how hashtags should behave.

@mjpeet mjpeet added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Oct 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed.

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants