Skip to content

WestMidlands| SDC NOV 2025| Sara Tahir| Sprint 1| Feature HashtagLink#109

Open
SaraTahir28 wants to merge 2 commits intoCodeYourFuture:mainfrom
SaraTahir28:feature/fixhashtaglink
Open

WestMidlands| SDC NOV 2025| Sara Tahir| Sprint 1| Feature HashtagLink#109
SaraTahir28 wants to merge 2 commits intoCodeYourFuture:mainfrom
SaraTahir28:feature/fixhashtaglink

Conversation

@SaraTahir28
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

Changelist

  1. Updated the formatHashtags regex so it only matches valid hashtag characters (letters, numbers, underscores) instead of everything up to the next #.

2.This prevents cases like #SwizBiz love!! from being treated as one long hashtag and generating a broken link.

3.Now hashtags stop at spaces/punctuation, so links like /hashtag/SwizBiz work correctly and show the expected blooms.

Questions

I have no Questions. Thankyou.

@SaraTahir28 SaraTahir28 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 4, 2026
Copy link

@OracPrime OracPrime left a comment

Choose a reason for hiding this comment

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

A simplification can be applied for the non-stretch objective, but there's a stretch objective too. However I realise time pressure is mounting so feel free to skip the stretch!


return text.replace(
/\B#[^#]+/g,
/\B#[a-zA-Z0-9_]+/g,

Choose a reason for hiding this comment

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

This works for anything I'm likely to type, but would struggle with #پاکستان
And for anything I'm likely to type, /\B#\w+/g would work, as a-zA-Z0-9_ is w in regex.

Stretch objective: make #پاکستان work!

Copy link
Author

Choose a reason for hiding this comment

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

I have simplified the regex and commited the non stretch version for now. I looked at the stretch objective and reseearched about unicode hashtags for which I will need unicode tags for regex,I was not sure how to test it atm so I have skipped it for now.

@OracPrime OracPrime added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Feb 10, 2026
@SaraTahir28 SaraTahir28 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 10, 2026
Copy link

@OracPrime OracPrime left a comment

Choose a reason for hiding this comment

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

That's fine!

@OracPrime OracPrime 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 Feb 13, 2026
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. Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants