Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
murdercode authored and github-actions[bot] committed Feb 22, 2023
1 parent 4e984ea commit be53d5a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Parsers/Instagram.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ public static function parse(string $content): string
return preg_replace_callback(
'/\[instagram url="(.*?)"]/',
function ($matches) {

$url = str_contains($matches[1], 'instagram.com') ? $matches[1] : null;

$regex = '/\/p\/([a-zA-Z0-9_-]+)/';
preg_match($regex, $url, $matches);
$post_id = $matches[1];

$embed_url = "https://www.instagram.com/p/" . $post_id . "/embed";
$embed_url = 'https://www.instagram.com/p/'.$post_id.'/embed';
if ($url) {
return view('shortcode-plus::instagram', compact('embed_url'))->render();
}
Expand Down

0 comments on commit be53d5a

Please sign in to comment.