Twitch Chat
The current implementation only shows link previews for twitch content, Mux mentioned it would be nice to display more than twitch links.
If we end up only using twitch, or at least making sure we render twitch stuff properly, these are some regular expressions for twitch links:
/**
* (?:^|\s)(?:https?:\/\/)?clips.twitch.tv\/((?:\w|_|-|=)+)(?:\/)?(\w+)?(?:\/edit)?**(?:$|\s)?
* (?:^|\s)(?:https?:\/\/)?(?:www\.)?twitch\.tv\/(\w+)\/clip\/((\w|_|-|=)+)(?:$|\s)?
* (?:^|\s)(?:https?:\/\/)?(?:(?:www|go).)?twitch.tv\/videos\/(\d+)(?:$|\s)?
*/
new RegExp("(?:^|\\s)(?:https?://)?clips.twitch.tv/((?:\\w|_|-|=)+)(?:/)?(\\w+)?(?:/edit)?(?:$|\\s)?")
new RegExp("(?:^|\\s)(?:https?:\\/\\/)?(?:www\\.)?twitch\\.tv\\/(\\w+)\\/clip\\/((\\w|_|-|=)+)(?:$|\\s)?");
new RegExp("(?:^|\\s)(?:https?://)?(?:(?:www|go).)?twitch.tv/videos/(\\d+)(?:$|\\s)?");
var s = /(?:(https?:\/\/)?((?:[\w#%\-+=:~]+\.)+[a-z]{2,10}(?:\/[\w./#%&@()\-+=:?~]*[^\.!,?])?))/;More notes
After discussing this topic further the ideal feature would be to have link previews for more than twitch links (clips and videos), I guess it might be useful to show some sort of preview for any site… I guess there might be some information about the site that developers usually present using some specific HTML tag?