<!-- Modal -->
<div class="modal fade"  id="code_blockModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
  <div class="modal-dialog" >
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title fw-bold">Update Code</h5>
        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
    </div>
      
      <div class="modal-body">
        <form method="POST" id="edit-code-form" enctype="multipart/form-data">
        <?= csrf_field(); ?>
          <input type="hidden" name="post_id">
          <input type="hidden" name="id">
          <label class="form-label fw-bold" for="code">Update Code</label>
          <textarea name="code" class="form-control rounded-0" rows="3" placeholder="Click in me to see code" id="code-editorz"></textarea>
           
          
        </form>                  
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-bs-dismiss="modal">Close</button>
        <button type="button" onclick="update_codeblock()" class="btn btn-outline-danger d-block w-50 stbtn" >Add Code</button>
      </div>
    </div>
    
  </div>
</div>
<script>
    // Initialize CodeMirror
    var editor = CodeMirror.fromTextArea(document.getElementById("code-editorz"), {
        mode: "htmlmixed", // Set the mode to HTML, or use other modes like JavaScript
        lineNumbers: true, // Show line numbers
        tabSize: 2, // Set the tab size
        theme: "default", // Choose a theme (you can create custom themes)
    });
</script>
<!-- End of Post Block Modal !-->