diff --git a/src/components/controls/atoms/Media.js b/src/components/controls/atoms/Media.js index 55bb2a9..f127097 100644 --- a/src/components/controls/atoms/Media.js +++ b/src/components/controls/atoms/Media.js @@ -65,9 +65,12 @@ const Media = ({ src, title }) => { case "Tweet": const tweetIdRegex = - /https?:\/\/twitter.com\/[0-9a-zA-Z_]{1,20}\/status\/([0-9]*)/; + /https?:\/\/(mobile\.){0,1}twitter.com\/[0-9a-zA-Z_]{1,20}\/status\/([0-9]*)/; const match = tweetIdRegex.exec(src); - const tweetId = match[1]; + if (!match || match.length < 2) { + return null; + } + const tweetId = match[match.length - 1]; return (