Skip to content

Commit

Permalink
Merge pull request #87 from zecka/issues/86-support-username-reel-format
Browse files Browse the repository at this point in the history
#86 Sanitize Instagram URL to support /username/reel format
  • Loading branch information
justinmahar authored Oct 3, 2024
2 parents c8b1120 + 5884a20 commit ef0bc19
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/embeds/InstagramEmbed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export const InstagramEmbed = ({
// END Embed Stages
// === === === === === === === === === === === === === === === === === === ===

const urlWithNoQueryOrUsername = url.split(/[?#]/)[0].replace(/\.com\/.*?\/p/, '.com/p');
const urlWithNoQueryOrUsername = url.split(/[?#]/)[0].replace(/\.com\/.*?\/p/, '.com/p').replace(/\.com\/.*?\/reel/, '.com/reel');
const cleanUrlWithEndingSlash = `${urlWithNoQueryOrUsername}${urlWithNoQueryOrUsername.endsWith('/') ? '' : '/'}`;

const isPercentageWidth = !!width?.toString().includes('%');
Expand Down

0 comments on commit ef0bc19

Please sign in to comment.