Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

handle hashtags in statuses #348

Merged
merged 1 commit into from
Mar 1, 2023
Merged

handle hashtags in statuses #348

merged 1 commit into from
Mar 1, 2023

Conversation

dario-piotrowicz
Copy link
Member

  • by parsing them in enrichStatus
  • implementing a tag page to show their timeline

resolves #345


const getLinkAnchorPlaceholder = (link: string) => {
const anchor = getLinkAnchor(link)
const placeholder = `%%%___-LINK-PLACEHOLDER-${crypto.randomUUID()}-__%%%`
Copy link
Member

Choose a reason for hiding this comment

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

why is a placeholder needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

because you can have # in urls (for pages' fragments) like so for example:

'https://developers.cloudflare.com/workers/runtime-apis/request/#background',

so I am using the placeholders to completely remove the links temporarily, apply the hashtags replacement and then I put back the links when it is ok to do so.

Alternatively I could have changed the hashtag replacement code to be smarter and check that the hashtag is not part of a url, but I felt like that could become quite complex and error prone, so I thought I could just use this placeholder strategy instead

what do you think?

Copy link
Member

@xtuc xtuc left a comment

Choose a reason for hiding this comment

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

fine to merge as is, thanks

 - by parsing them in enrichStatus
 - implementing a tag page to show their timeline

resolves #345
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Still having issues that Hashtags don't work
2 participants