Enable clickable link in YouTube Shorts comments - #96 #100
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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