Skip to content

Instantly share code, notes, and snippets.

@johnfmorton
Last active June 12, 2024 18:03
Show Gist options
  • Save johnfmorton/1f92f09ab3b2ffd23e4df4c06b0333a8 to your computer and use it in GitHub Desktop.
Save johnfmorton/1f92f09ab3b2ffd23e4df4c06b0333a8 to your computer and use it in GitHub Desktop.
Sample HTMLPurifier config to allow YouTube and Vimeo embeds - used with CKEditor in Craft CMS
{
"HTML.SafeIframe": true,
"URI.SafeIframeRegexp": "%^(https?:)?//(www.youtube.com/|youtube.com/|youtu.be/|player.vimeo.com/)%"
}
@johnfmorton
Copy link
Author

I've updated this Gist with additional YouTube URL options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment