make twitter regex work with query params

This commit is contained in:
keyan 2022-01-21 12:37:36 -06:00
parent a9fb5c8fe6
commit cf4ae37087
1 changed files with 1 additions and 1 deletions

View File

@ -34,7 +34,7 @@ function BioItem ({ item, handleClick }) {
function ItemEmbed ({ item }) {
const darkMode = useDarkMode()
const twitter = item.url?.match(/^https?:\/\/twitter\.com\/(?:#!\/)?\w+\/status(?:es)?\/(?<id>\d+)$/)
const twitter = item.url?.match(/^https?:\/\/twitter\.com\/(?:#!\/)?\w+\/status(?:es)?\/(?<id>\d+)/)
if (twitter?.groups?.id) {
return <TweetEmbed id={twitter.groups.id} options={{ width: '100%', theme: darkMode.value ? 'dark' : 'light' }} />
}