Skip to content

Enable clickable link in YouTube Shorts comments - #96#100

Draft
adsuth wants to merge 2 commits intoynshung:masterfrom
adsuth:#96
Draft

Enable clickable link in YouTube Shorts comments - #96#100
adsuth wants to merge 2 commits intoynshung:masterfrom
adsuth:#96

Conversation

@adsuth
Copy link
Collaborator

@adsuth adsuth commented Sep 13, 2023

Changed the names of the intervals to be a bit more generic.
Added a new "low priority" interval that fires every second.
That interval currently handles the new "returning links" implementation.

Essentially, just replaces any text-based link with an <a> tag link that can be clicked.

Handles HTTP, FTP and WWW links, as well as those without (eg: "youtube.com", it'll just affix "http://" to the start)

A link is selected via regex, specifically, this: /[^\s]+\.[^\s]{2,}/g
Any collection of non-space characters that is contiguous with a period, and then has two or more non-space characters thereafter is considered a link.

There will be issues with this; if a comment has, for example "this isn.ta link", it'll register http://isn.ta as a link. These can be ignored mind you.

(this will likely only work with first level comments, not replies)

For #96

@ynshung ynshung changed the title For #96 - Basic implementation for request Enable clickable link in YouTube Shorts comments - #96 Sep 14, 2023
@ynshung ynshung changed the base branch from v3 to master October 4, 2023 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant