title: htmlpurifier with an html5 doctype
body: <p>Is it possible to have htmlpurifier use the html5  doctype? </p>
  
  <p>The documentation <a href="http://htmlpurifier.org/download" rel="noreferrer">here</a> states that you can change the doctype and encoding with the following:</p>
  
  <pre><code>&lt;?php
      require_once '/path/to/htmlpurifier/library/HTMLPurifier.auto.php';
  
      $config = HTMLPurifier_Config::createDefault();
      $config-&gt;set('Core', 'Encoding', 'ISO-8859-1'); // replace with your encoding
      $config-&gt;set('HTML', 'Doctype', 'HTML 4.01 Transitional'); // replace with your doctype
      $purifier = new HTMLPurifier($config);
  
      $clean_html = $purifier-&gt;purify($dirty_html);
  ?&gt;
  </code></pre>
  
  <p>but then in the install instructions <a href="http://repo.or.cz/w/htmlpurifier.git?a=blob;f=INSTALL;hb=v4.2.0" rel="noreferrer">here</a> states that the supported doctypes are:</p>
  
  <pre><code>256 Other supported doctypes include:
  257
  258     * HTML 4.01 Strict
  259     * HTML 4.01 Transitional
  260     * XHTML 1.0 Strict
  261     * XHTML 1.0 Transitional
  262     * XHTML 1.1
  </code></pre>
  
  <p>Is it possible to do the following to allow html5 doctype?</p>
  
  <pre><code>&lt;?php
          require_once '/path/to/htmlpurifier/library/HTMLPurifier.auto.php';
  
          $config = HTMLPurifier_Config::createDefault();
          $config-&gt;set('Core', 'Encoding', 'UTF-8'); // replace with your encoding
          $config-&gt;set('HTML', 'Doctype', 'html5'); // replace with your doctype
          $purifier = new HTMLPurifier($config);
  
          $clean_html = $purifier-&gt;purify($dirty_html);
      ?&gt;
  </code></pre>
  
  <p>Or is there another way?</p>