Answers.Body: <p>Have you tried using the <code>allowedTags</code> attribute in your Redactor config?</p>
  
  <pre><code>$('#redactor').redactor({
      allowedTags: ['div','p', 'h1', 'h2', 'pre']
  });
  </code></pre>
  
  <p>You can read about that here:</p>
  
  <p><a href="http://imperavi.com/redactor/docs/settings/clean/#setting-allowedTags" rel="nofollow">http://imperavi.com/redactor/docs/settings/clean/#setting-allowedTags</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-12-24T19:43:59.627Z
Answers.LastActivityDate: 2014-12-24T19:43:59.627Z
Answers.UserDisplayName: Mark Busnelli Jr
Answers.Body: <p>Add <code>replaceDivs: false</code> only once in your JSON config and do not forget <strong><em>the comma</em></strong> at the end of each settings row.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-18T18:46:32.440Z
Answers.LastActivityDate: 2016-02-18T18:46:32.440Z
Answers.UserDisplayName: tao
Answers.Body: <p>For me adding <code>replaceDivs: false</code> in redactor config file fixed my issue on div tag removal.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-01T17:09:33.700Z
Answers.LastActivityDate: 2015-09-01T17:09:33.700Z
Answers.UserDisplayName: migmaker
Body: <p>When i enter HTML into redactor below it will strip out the first closing div and the second opening div leaving one col-md-6.  It actually saves it as I have below but as soon as redactor is re-initialised it strips out the closing and opening tag in the middle again.  This means no one can ever go in an edit the content as it will be a single column again once saved. Current setup of redactor is below and I have unchecked the clean HTML.</p>
  
  <pre><code>&lt;div class="row"&gt;
      &lt;div class="col-md-6"&gt;
          &lt;p&gt;One Col&lt;/p&gt;
      &lt;/div&gt;
      &lt;div class="col-md-6"&gt;
      &lt;p&gt;One Col&lt;/p&gt;
      &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>Redactor JSON config:</p>
  
  <pre><code>{
          buttons: ['html','formatting','bold','italic','unorderedlist','orderedlist','link','image','video'],
          plugins: ['fullscreen'],
          toolbarFixedBox: true,
          replaceDivs: false
          replaceDivs: false,
          paragraphize: false,
          removeEmpty: ['strong', 'em', 'span', 'p']
      }
  </code></pre>
  
  <p>Any ideas how I can get it just to accept the HTML we enter without problems?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-12-22T17:16:31.863Z
Comments.Text: Hi Andy, this doesn't answer your question but is something to consider; having 'complex' markup like this in a Rich Text field may not be the best idea, it might be worth considering a Matrix field (depending on the context here): http://buildwithcraft.com/docs/matrix-fields or another Craft field that handles purely the content, and the column markup is defined in your templates.
Comments.UserDisplayName: Jamie Wade
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-12-22T17:22:48.333Z
Comments.Text: Thansk for responding Jamie but this is actually a matrix field :(  Its quite annoying!
Comments.UserDisplayName: Andy Lake
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-12-22T18:22:38.247Z
Comments.Text: You mean the RTE is inside of a Matrix field? What Jamie is suggesting is ditching the RTE altogether and solely use a Matrix field. You'll have much more control over the markup, then.
Comments.UserDisplayName: Brad Bell
Tags: <redactor>
Title: HTML being stripped/replaced by redactor on initialising despite being saved correctly
ThreadText: # HTML being stripped/replaced by redactor on initialising despite being saved correctly
  
  (Asked by: username_0 on 2014-12-22)
  
  When i enter HTML into redactor below it will strip out the first closing div and the second opening div leaving one col-md-6. It actually saves it as I have below but as soon as redactor is re-initialised it strips out the closing and opening tag in the middle again. This means no one can ever go in an edit the content as it will be a single column again once saved. Current setup of redactor is below and I have unchecked the clean HTML.
  
  ```
  <div class="row">
      <div class="col-md-6">
          <p>One Col</p>
      </div>
      <div class="col-md-6">
      <p>One Col</p>
      </div>
      </div>
  
  ```
  
  Redactor JSON config:
  
  ```
  {
          buttons: ['html','formatting','bold','italic','unorderedlist','orderedlist','link','image','video'],
          plugins: ['fullscreen'],
          toolbarFixedBox: true,
          replaceDivs: false
          replaceDivs: false,
          paragraphize: false,
          removeEmpty: ['strong', 'em', 'span', 'p']
      }
  
  ```
  
  Any ideas how I can get it just to accept the HTML we enter without problems?
  
  **Tags:** redactor
  
  > **Comments:**
  > **username_1**: Hi username_0, this doesn't answer your question but is something to consider; having 'complex' markup like this in a Rich Text field may not be the best idea, it might be worth considering a Matrix field (depending on the context here): http://buildwithcraft.com/docs/matrix-fields or another Craft field that handles purely the content, and the column markup is defined in your templates.  
  > **username_0**: Thansk for responding username_1 but this is actually a matrix field :(  Its quite annoying!  
  > **username_2**: You mean the RTE is inside of a Matrix field? What username_1 is suggesting is ditching the RTE altogether and solely use a Matrix field. You'll have much more control over the markup, then.  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_3 on 2014-12-24. Score: 3
  
  Have you tried using the `allowedTags` attribute in your Redactor config?
  
  ```
  $('#redactor').redactor({
      allowedTags: ['div','p', 'h1', 'h2', 'pre']
  });
  
  ```
  
  You can read about that here:
  
  <http://imperavi.com/redactor/docs/settings/clean/#setting-allowedTags>
  
  
  ---
  
  ### Answer by username_4 on 2016-02-18. Score: 3
  
  Add `replaceDivs: false` only once in your JSON config and do not forget ***the comma*** at the end of each settings row.
  
  
  ---
  
  ### Answer by username_5 on 2015-09-01. Score: 2
  
  For me adding `replaceDivs: false` in redactor config file fixed my issue on div tag removal.
  
  
  ---
  
  