title: Convert escaped less than sign inside pre tags
body: <p>I'm using HTMLPurifier to escape characters within my site. Effectively turning all <code>&lt;</code> and <code>&gt;</code> into <code>&amp;gt;</code> and <code>&amp;lt</code> as it should. I also want to display code within the site, but when placing code onto the site using <code>&lt;pre&gt;&lt;code&gt;...&lt;/code&gt;&lt;/pre&gt;</code>, instead of rendering the <code>&amp;gt;</code> and <code>&amp;lt</code> symbols as <code>&lt;</code> and <code>&gt;</code> they stay displaying as their encoded <code>&amp;gt;</code>.</p>
  
  <p><em>I know that the</em> <code>&lt;pre&gt;</code> <em>tag is meant to show pre-formatted text</em></p>
  
  <p>How would I safely convert these symbols (<code>&amp;gt;</code> &amp; <code>&amp;lt;</code>), only when wrapped in a <code>&lt;pre&gt;&lt;code&gt;...&lt;/code&gt;&lt;/pre&gt;</code> tags to render as (<code>&lt;</code> &amp; <code>&gt;</code>) using JS/JQuery?</p>
  
  <p><code>&lt;php 'default' =&gt; 'local'</code> converts into <code>&amp;lt;php 'default' =&amp;gt; 'local'</code></p>
  
  <p>NOTE: This doesn't happen when rendering HTML tags. I believe it is something that is caused by HTMLPurifier.</p>
  
  <p>HTML renders correctly as</p>
  
  <pre><code>    &lt;div&gt;
        ...Some code here...
      &lt;/div&gt;
  </code></pre>
  
  <h2>UPDATE #1:</h2>
  
  <p>I'm using Markdown on the site and my HTMLPurifier config is as follows:</p>
  
  <pre><code>    &lt;?php
      /**
       * Ok, glad you are here
       * first we get a config instance, and set the settings
       * $config = HTMLPurifier_Config::createDefault();
       * $config-&gt;set('Core.Encoding', $this-&gt;config-&gt;get('purifier.encoding'));
       * $config-&gt;set('Cache.SerializerPath', $this-&gt;config-&gt;get('purifier.cachePath'));
       * if ( ! $this-&gt;config-&gt;get('purifier.finalize')) {
       *     $config-&gt;autoFinalize = false;
       * }
       * $config-&gt;loadArray($this-&gt;getConfig());
       *
       * You must NOT delete the default settings
       * anything in settings should be compacted with params that needed to instance HTMLPurifier_Config.
       *
       * @link http://htmlpurifier.org/live/configdoc/plain.html
       */
  
      return [
          'encoding'      =&gt; 'UTF-8',
          'finalize'      =&gt; true,
          'cachePath'     =&gt; storage_path('app/purifier'),
          'cacheFileMode' =&gt; 0755,
          'settings'      =&gt; [
              'default' =&gt; [
                  'HTML.Doctype'             =&gt; 'HTML 4.01 Transitional',
                  'HTML.Allowed'             =&gt; 'blockquote,h1,h2,h3,h4,h5,h6,pre,code,div[class],b,strong,i,em,a[href|title],ul,ol,li,p[style],br,span[style],img[width|height|alt|src]',
                  'CSS.AllowedProperties'    =&gt; 'font,font-size,font-weight,font-style,font-family,text-decoration,padding-left,color,background-color,text-align',
                  'AutoFormat.AutoParagraph' =&gt; false,
                  'AutoFormat.RemoveEmpty'   =&gt; true,
              ],
              'test'    =&gt; [
                  'Attr.EnableID' =&gt; true
              ],
              "youtube" =&gt; [
                  "HTML.SafeIframe"      =&gt; 'true',
                  "URI.SafeIframeRegexp" =&gt; "%^(http://|https://|//)(www.youtube.com/embed/|player.vimeo.com/video/)%",
              ],
          ],
  
      ];
  
  This is the method I'm using to call the Purifier
  
      public function store(Request $request)
          {
              //Validate the data
              $this-&gt;validate($request, array(
                  'title' =&gt; 'required|max:255',
                  'slug' =&gt; 'required|alpha_dash|min:5|max:255|unique:posts,slug',
                  'category_id' =&gt;'required|integer',
                  'body' =&gt; 'required'
              ));
              //Store in the database
              $post = new Post;
  
              $post-&gt;title = $request-&gt;title;
              $post-&gt;slug = $request-&gt;slug;
              $post-&gt;category_id = $request-&gt;category_id;
              $post-&gt;body = Purifier::clean($request-&gt;body, "youtube");
  
              $post-&gt;save();
  
              $post-&gt;tags()-&gt;sync($request-&gt;tags, false);
  
              Session::flash('success', 'AWESOMESAUCE! Your post was saved successfully!');
  
              //redirect to another page
              return redirect()-&gt;route('posts.show', $post-&gt;id);
  
          }
  </code></pre>
  
  <h2>UPDATE #2 (02/19/19)</h2>
  
  <p>The issue caused me to search the previous code. The issue came from the Markdown parser, which is <em>Parsedown</em> and not the Purifier. Purifier was working properly. I've added the Markdown configuration and usage code below:</p>
  
  <pre><code>&lt;?php
  
  /*
   * This file is part of Laravel Markdown.
   *
   * (c) Graham Campbell &lt;graham@alt-three.com&gt;
   *
   * For the full copyright and license information, please view the LICENSE
   * file that was distributed with this source code.
   */
  
  return [
  
      /*
      |--------------------------------------------------------------------------
      | Enable View Integration
      |--------------------------------------------------------------------------
      |
      | This option specifies if the view integration is enabled so you can write
      | markdown views and have them rendered as html. The following extensions
      | are currently supported: ".md", ".md.php", and ".md.blade.php". You may
      | disable this integration if it is conflicting with another package.
      |
      | Default: true
      |
      */
  
      'views' =&gt; true,
  
      /*
      |--------------------------------------------------------------------------
      | CommonMark Extenstions
      |--------------------------------------------------------------------------
      |
      | This option specifies what extensions will be automatically enabled.
      | Simply provide your extension class names here.
      |
      | Default: []
      |
      */
  
      'extensions' =&gt; [],
  
      /*
      |--------------------------------------------------------------------------
      | Renderer Configuration
      |--------------------------------------------------------------------------
      |
      | This option specifies an array of options for rendering HTML.
      |
      | Default: [
      |              'block_separator' =&gt; "\n",
      |              'inner_separator' =&gt; "\n",
      |              'soft_break'      =&gt; "\n",
      |          ]
      |
      */
  
      'renderer' =&gt; [
          'block_separator' =&gt; "\n",
          'inner_separator' =&gt; "\n",
          'soft_break'      =&gt; "\n",
      ],
  
      /*
      |--------------------------------------------------------------------------
      | Enable Em Tag Parsing
      |--------------------------------------------------------------------------
      |
      | This option specifies if `&lt;em&gt;` parsing is enabled.
      |
      | Default: true
      |
      */
  
      'enable_em' =&gt; true,
  
      /*
      |--------------------------------------------------------------------------
      | Enable Strong Tag Parsing
      |--------------------------------------------------------------------------
      |
      | This option specifies if `&lt;strong&gt;` parsing is enabled.
      |
      | Default: true
      |
      */
  
      'enable_strong' =&gt; true,
  
      /*
      |--------------------------------------------------------------------------
      | Enable Asterisk Parsing
      |--------------------------------------------------------------------------
      |
      | This option specifies if `*` should be parsed for emphasis.
      |
      | Default: true
      |
      */
  
      'use_asterisk' =&gt; true,
  
      /*
      |--------------------------------------------------------------------------
      | Enable Underscore Parsing
      |--------------------------------------------------------------------------
      |
      | This option specifies if `_` should be parsed for emphasis.
      |
      | Default: true
      |
      */
  
      'use_underscore' =&gt; true,
  
      /*
      |--------------------------------------------------------------------------
      | Safe Mode
      |--------------------------------------------------------------------------
      |
      | This option specifies if raw HTML is rendered in the document. Setting
      | this to true will not render HTML, and false will.
      |
      | Default: false
      |
      */
  
      'safe' =&gt; true,
  
  ];
  </code></pre>
  
  <p>Usage:</p>
  
  <pre><code>&lt;img class="img-responsive" src="{{ asset('assets/img/' . $post-&gt;image) }}" alt="{{ $post-&gt;alt }}" /&gt;
      {!! Markdown::parse($post-&gt;body) !!}
      &lt;hr /&gt;
  </code></pre>