<div class="content-block instagram-block">
  <%=
    instagram_block_patterns = [
      /<blockquote (.*)<\/blockquote>(\s+)<script async defer src="\/\/platform.instagram.com\/en_US\/embeds.js"><\/script>/,
      /<blockquote (.*)<\/blockquote>(\s+)<script async defer src="www.instagram.com\/embed.js"><\/script>/
    ]
    if block['instagram_embed_code'] && instagram_block_patterns.any? { |pattern| pattern.match(block['instagram_embed_code'].html_safe) }
      block['instagram_embed_code'].html_safe
    else
      ''
    end
  %>
</div>

<div class="content-block instagram-block">
  <%=
    instagram_block_patterns = [
      /<blockquote (.*)<\/blockquote>(\s+)<script async defer src="\/\/platform\.instagram\.com\/en_US\/embeds\.js"><\/script>/,
      /<blockquote (.*)<\/blockquote>(\s+)<script async defer src="\/\/www\.instagram\.com\/embed\.js"><\/script>/
    ]
    if block['instagram_embed_code'] && instagram_block_patterns.any? { |pattern| pattern.match(block['instagram_embed_code'].html_safe) }
      block['instagram_embed_code'].html_safe
    else
      ''
    end
  %>
</div>

Fix pattern for Instagram block
Fix pattern for Instagram block
