Twitter vs x - url treatment by the forum
-
I was noticing all my Twitter links were showing up as naked urls but George’s were still displaying correctly. Looking into it, I see that he was still using Twitter.com in his urls whereas mine were x.com.
Just now I edited an x link and replaced x with Twitter and it displayed.
I guess this is both a PSA and a question to the tech gurus if that’s something that can be fixed.
George - do you go back and edit your links or are you somehow still able to copy Twitter links directly from the app or web version?
@jon-nyc said in Twitter vs x - url treatment by the forum:
George - do you go back and edit your links or are you somehow still able to copy Twitter links directly from the app or web version?
I use the web version of "X" with safari. I just "copy" link and paste it into the forum:
https://t witter.com/TomBevanRCP/status/1700114280501129301?s=20
The URL still shows as twitter.
-
I'm sure you are all dying to know how I did this: I cloned the repository of the plugin and changed the regular expression that searches for twitter URLs to also include x.com URLs.
Specifically, I replaced this line of code
const regularUrl = /<a href="(?:https?:\/\/)?(?:(?:(?:mobile|www)\.)?twitter\.com)\/([^\/"\s]*)\/statuse?s?\/([^\/"\s]*)(\/photo\/\d|)".*?>.+?<\/a>/g
by this
const regularUrl = /<a href="(?:https?:\/\/)?(?:(?:(?:mobile|www)\.)?(twitter|x)\.com)\/([^\/"\s]*)\/statuse?s?\/([^\/"\s]*)(\/photo\/\d|)".*?>.+?<\/a>/g
It was important for me to let you know about this.