protected static function _buildHtmlPurifierConfig($options)
	{
		$config = \HTMLPurifier_Config::createDefault();
		$root = str_replace(['http://', 'https://', '.'], ['', '', '\.'], \App::get('request')->root());
		$defaultSettings = [
			'AutoFormat.Linkify' => false,
			'AutoFormat.RemoveEmpty' => true,
			'AutoFormat.RemoveEmpty.RemoveNbsp' => false,
			'Output.CommentScriptContents' => false,
			'Output.TidyFormat' => true,
			'Attr.AllowedFrameTargets' => ['_blank'],
			'Attr.EnableID' => true,
			'HTML.AllowedCommentsRegexp' => '/./',
			'HTML.SafeIframe' => true,
			'URI.SafeIframeRegexp' => "%^(https?:)?//(www\.youtube(?:-nocookie)?\.com/embed/|player\.vimeo\.com/video/|$root)%",
		];
		$combinedSettings = array_merge($defaultSettings, $options);

		self::_findOrCreateClientSerializerDirectory($combinedSettings);

		foreach ($combinedSettings as $setting => $value)
		{
			$config->set($setting, $value);
		}

		return $config;
	}