HTML Purifier Config File I noticed the following new feature in Craft CMS 2.6.2973: Added the “HTML Purifier Config” setting to Rich Text fields.

I can't see any mention or any example of config files in the Craft CMS docs for Rich Text fields though, and the only thing I can see in the Rich Text Field settings in the control panel is this:


  You can save custom HTML Purifier configs as .json files in craft/config/htmlpurifier/. View available settings


Can someone help me with a custom HTML Purifier config .json file that I can use with Craft that would allow me to start using YouTube video embed code like this in Rich Text fields?

&lt;iframe width="560" height="315" src="https://www.youtube.com/embed/HdYfAmrzVlc" frameborder="0" allowfullscreen=""&gt;&lt;/iframe&gt;


At the moment, the above code will disappear when saving an entry unless I disable the Purify HTML? option in the Rich Text field settings. Thanks in advance for any help with this.
Something like this in a .json file should work:
{
  &quot;HTML.SafeIframe&quot;: true,
  &quot;URI.SafeIframeRegexp&quot;: &quot;%^(https?:)?//(www\\.youtube(?:-nocookie)?\\.com/embed/)%&quot;,
  &quot;Attr.AllowedFrameTargets&quot;: [&quot;_blank&quot;],
  &quot;HTML.AllowedComments&quot;: [&quot;pagebreak&quot;]
}

Note that the first two lines were adapted from https://stackoverflow.com/a/12784081/684 and the last two are the default options that Craft uses if no custom config is set.
Probably also worth giving this a read: http://htmlpurifier.org/docs/enduser-youtube.html