WestMidlands| SDC NOV 2025| Sara Tahir| Sprint 1| Feature HashtagLink#109
WestMidlands| SDC NOV 2025| Sara Tahir| Sprint 1| Feature HashtagLink#109SaraTahir28 wants to merge 2 commits intoCodeYourFuture:mainfrom
Conversation
OracPrime
left a comment
There was a problem hiding this comment.
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!
front-end/components/bloom.mjs
Outdated
|
|
||
| return text.replace( | ||
| /\B#[^#]+/g, | ||
| /\B#[a-zA-Z0-9_]+/g, |
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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.
Learners, PR Template
Self checklist
Changelist
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.