Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions front-end/components/bloom.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,12 @@ const createBloom = (template, bloom) => {
function _formatHashtags(text) {
if (!text) return text;
return text.replace(
/\B#[^#]+/g,
(match) => `<a href="/hashtag/${match.slice(1)}">${match}</a>`
);
/\B#\w+/g,
(match) => {
const tag = match.slice(1);
return `<a href="/hashtag/${match.slice(1)}">${match}</a>`;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You've extracted the match to tag, but then re-extracted it. You either need to lose line 42 or use tag in line 43!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Not very smart of me.
Got rid of the variable tag altogether.


});
}

function _formatTimestamp(timestamp) {
Expand Down