Display pure html code in tinymce laravel
<p>Hi I am using tinmymce in laravel5. I create blogposts where i need to display code snippets.
for example i want to display this bit of code snippet <code>&lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;</code> and here is my source code as seen in tinymce:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;pre&gt;&lt;code&gt;&amp;lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&amp;gt;&lt;/code&gt;&lt;/pre&gt;</code></pre>
</div>
</div>
</p>

<p>And this is how it is saved in my database:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;pre&gt;&lt;code&gt;&amp;lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&amp;gt;&lt;/code&gt;&lt;/pre&gt;</code></pre>
</div>
</div>
</p>

<p>The problem is when i pull that data to edit in my view using the same tinymce editor
I see nothing, its blank. if i check the source code all is left there is <code>&lt;pre&gt;&lt;/pre&gt;</code></p>

<p>Here is my create page:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>@extends('layouts.app')
@section('content')

&lt;section class="articles-show"&gt;
    &lt;div class="container"&gt;
        &lt;div class="row"&gt;
            &lt;div class="col-sm-10 articles-page"&gt;

                &lt;h1&gt;Create Article&lt;/h1&gt;
                {{-- @if (Auth::user()-&gt;isAuthor() || Auth::user()-&gt;isAdmin()) --}}
                {!! Form::open(['method' =&gt; 'POST', 'action' =&gt; 'ArticlesController@store', 'files' =&gt; true]) !!}
                @include('partials.error-message')
                &lt;div class="form-group"&gt;
                    {!! Form::label("title", "Title:") !!}
                    {!! Form::text("title", null, ['class' =&gt; 'form-control']) !!}
                &lt;/div&gt;

                &lt;div class="form-group"&gt;
                    {!! Form::label("body", "Body:") !!}
                    {!! Form::textarea("body", null, ['class' =&gt; 'form-control']) !!}  
                &lt;/div&gt;

                &lt;div class="form-group"&gt;
                    {!! Form::label('photo_id', 'Featured Image:') !!}
                    {!! Form::file('photo_id', array('class' =&gt; 'form-control')) !!}
                &lt;/div&gt;

                &lt;div class="form-group"&gt;
                    {!! Form::label("category_id", "Category:") !!}
                    {!! Form::select("category_id[]", $categories, null, ['id' =&gt; 'tag_list', 'class' =&gt; 'form-control', 'multiple']) !!}
                &lt;/div&gt;

                &lt;div class="form-group"&gt;
                    {!! Form::label("meta_desc", "Meta Description:") !!}
                    {!! Form::text("meta_desc", null, ['class' =&gt; 'form-control']) !!}
                &lt;/div&gt;

                &lt;div class="form-group"&gt;
                    {!! Form::submit("Create Article", ['class' =&gt; 'btn btn-primary']) !!}
                &lt;/div&gt;

                {!! Form::close() !!}
                {{-- @endif --}}
            &lt;/div&gt;
            &lt;div class="col-sm-2 articles-page"&gt;
                {!! Form::open(['method' =&gt; 'POST', 'action' =&gt; 'CategoryController@store']) !!}
                
                &lt;br&gt;
                &lt;div class="form-group"&gt;
                    {!! Form::label("name", "Category Name:") !!}
                    {!! Form::text("name", null, ['class' =&gt; 'form-control']) !!}
                &lt;/div&gt;

                &lt;div class="form-group"&gt;
                    {!! Form::submit("Create Category", ['class' =&gt; 'btn btn-primary']) !!}
                &lt;/div&gt;

                {!! Form::close() !!}
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/section&gt;

@include('partials.select-2-script')
@include('partials.tinymceScript')

@endsection</code></pre>
</div>
</div>
</p>

<p>Here is my edit page:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>@extends('layouts.app')
@section('content')

@section('content') 

&lt;section class="articles-show"&gt;
      &lt;div class="container"&gt;
        &lt;div class="row"&gt;
          &lt;div class="col-sm-10 articles-page"&gt;

            &lt;h1&gt;Create Article&lt;/h1&gt;

            {!! Form::model($article, ['method' =&gt; 'PATCH', 'action' =&gt; ['ArticlesController@update', $article-&gt;id], 'files' =&gt; true]) !!}
                @include('partials.error-message')
                &lt;div class="form-group"&gt;
                    {!! Form::label("title", "Title:") !!}
                    {!! Form::text("title", null, ['class' =&gt; 'form-control']) !!}
                &lt;/div&gt;

                &lt;div class="form-group"&gt;
                    {!! Form::label("body", "Body:") !!}
                    {!! Form::textarea("body", null, ['id' =&gt; 'mytextarea', 'class' =&gt; 'form-control']) !!}
                &lt;/div&gt;

                &lt;div class="form-group"&gt;
                    {!! Form::label('photo_id', 'Featured Image:') !!}
                    {!! Form::file('photo_id', array('class' =&gt; 'form-control')) !!}
                &lt;/div&gt;

                &lt;div class="form-group"&gt;
                    {!! Form::label("category_id", "Category:") !!}
                    {!! Form::select("category_id[]", $categories, null, ['id' =&gt; 'tag_list', 'class' =&gt; 'form-control', 'multiple']) !!}
                &lt;/div&gt;

                &lt;div class="form-group"&gt;
                    {!! Form::label("meta_desc", "Meta Description:") !!}
                    {!! Form::text("meta_desc", null, ['class' =&gt; 'form-control']) !!}
                &lt;/div&gt;

                &lt;div class="form-group"&gt;
                    {!! Form::submit("Edit Article", ['class' =&gt; 'btn btn-primary']) !!}
                &lt;/div&gt;

            {!! Form::close() !!}

            {!! Form::open(['method' =&gt; 'DELETE', 'action' =&gt; ['ArticlesController@destroy', $article-&gt;id]]) !!}
                &lt;div class="form-group"&gt;
                    {!! Form::submit("Delete Article", ['class' =&gt; 'btn btn-danger']) !!}
                &lt;/div&gt;
            {!! Form::close() !!}
            &lt;/div&gt;
            &lt;div class="col-sm-2 articles-page"&gt;

                {!! Form::open(['method' =&gt; 'POST', 'action' =&gt; 'CategoryController@store', 'files' =&gt; true]) !!}
                    &lt;br&gt;
                    &lt;div class="form-group"&gt;
                        {!! Form::label("name", "Category Name:") !!}
                        {!! Form::text("name", null, ['class' =&gt; 'form-control']) !!}
                    &lt;/div&gt;

                    &lt;div class="form-group"&gt;
                        {!! Form::submit("Create Category", ['class' =&gt; 'btn btn-primary']) !!}
                    &lt;/div&gt;

                {!! Form::close() !!}
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/section&gt;

    @include('partials.select-2-script')
    @include('partials.tinymceScript')

@endsection</code></pre>
</div>
</div>
</p>

<p>and here is my tinymce script page that is in partials which i have included in create and edit pages:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="http://code.jquery.com/jquery.js"&gt;&lt;/script&gt;
&lt;script src="//cdn.tinymce.com/4/tinymce.min.js"&gt;&lt;/script&gt;
&lt;script&gt;
      var editor_config = {
        path_absolute : "{{ URL::to('/') }}/",
        selector: "textarea",
        //entities : "60,lt,62,gt,38,amp",
        // entity_encoding: "raw",
        plugins: [
          "advlist autolink lists link image charmap print preview hr anchor pagebreak",
          "searchreplace wordcount visualblocks visualchars code fullscreen",
          "insertdatetime media nonbreaking save table contextmenu directionality",
          "emoticons template paste textcolor colorpicker textpattern spellchecker"
        ],
        toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image media | spellchecker",
        menubar: "tools",
        relative_urls: false,
        file_browser_callback : function(field_name, url, type, win) {
          var x = window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth;
          var y = window.innerHeight|| document.documentElement.clientHeight|| document.getElementsByTagName('body')[0].clientHeight;

          var cmsURL = editor_config.path_absolute + 'laravel-filemanager?field_name=' + field_name;
          if (type == 'image') {
            cmsURL = cmsURL + "&amp;type=Images";
          } else {
            cmsURL = cmsURL + "&amp;type=Files";
          }

          tinyMCE.activeEditor.windowManager.open({
            file : cmsURL,
            title : 'Filemanager',
            width : x * 0.8,
            height : y * 0.8,
            resizable : "yes",
            close_previous : "no"
          });
        }
      };

      tinymce.init(editor_config);
    &lt;!--   --&gt;
&lt;/script&gt;</code></pre>
</div>
</div>
</p>

<p>I have searched everywhere, tried everything posted in tinymce forums etc. Stackoverflow is my last hope :)</p>