Answers.Body: <p>In the Advanced section of your field definition, there are settings for clean-up actions and Purify HTML.</p>
  
  <p>I suggest trying to disable Purify (or use a custom config).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-04T20:33:30.153Z
Answers.Text: Also, make sure you use the raw filter in your Twig template: `{{ entry.myRedactorField|raw }}`.
Answers.UserDisplayName: lemp
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-04T20:40:27.650Z
Answers.Text: All those settings (Remove inline styles, Remove empty tags, Replace non-breaking spaces with regular spaces, Purify HTML) were turned off, and we are using the raw filter for the output.  The `<p>` tags are injected by javascript in redactor, but not sent forward to craft when the entry is saved.
Answers.UserDisplayName: Mark Middleton
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-04T20:45:59.623Z
Answers.Text: I've also tried *with* all those settings checked... no difference
Answers.UserDisplayName: Mark Middleton
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-04T22:38:25.917Z
Answers.Text: Here's what I found I can do as a workaround:
  
  -open the entry in the control panel
  -click preview -> content is bad (the <p> tags are in redactor, but not in the preview)
  -add a line of plain text to the content
  -click preview -> content is GOOD (and saves with newly added <p> tags)
Answers.UserDisplayName: Mark Middleton
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-04T20:00:14.620Z
Answers.LastActivityDate: 2020-06-04T20:00:14.620Z
Answers.UserDisplayName: lemp
Body: <p>We are in the midst of a migration from WordPress to Craft.  Much of the content contains line breaks, which are converted to <code>&lt;p&gt;</code> tags in Redactor (as seen in Redactor's view source plugin).</p>
  
  <p>But when the entry is saved (or previewed, as seen in the attached image), those <code>&lt;p&gt;</code> tags are stripped back out and never make it to the database.</p>
  
  <p>Is there a config setting to "retain the automatically applied formatting from redactor when the entry is saved"? (we want to keep these styles that were temporarily added in by redactor)</p>
  
  <p><a href="https://i.sstatic.net/decWE.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/decWE.png" alt="enter image description here"></a></p>
  
Tags: <craft3><redactor>
Title: CraftCMS Redactor is adding <p> tags to viewable source code... but then removes them when saving
ThreadText: # CraftCMS Redactor is adding <p> tags to viewable source code... but then removes them when saving
  
  (Asked by: username_0 on 2020-06-04)
  
  We are in the midst of a migration from WordPress to Craft. Much of the content contains line breaks, which are converted to `<p>` tags in Redactor (as seen in Redactor's view source plugin).
  
  But when the entry is saved (or previewed, as seen in the attached image), those `<p>` tags are stripped back out and never make it to the database.
  
  Is there a config setting to "retain the automatically applied formatting from redactor when the entry is saved"? (we want to keep these styles that were temporarily added in by redactor)
  
  [![enter image description here](https://i.sstatic.net/decWE.png)](https://i.sstatic.net/decWE.png)
  
  **Tags:** craft3, redactor
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-06-04. Score: 1
  
  In the Advanced section of your field definition, there are settings for clean-up actions and Purify HTML.
  
  I suggest trying to disable Purify (or use a custom config).
  
  > **Comments:**
  > **username_1**: Also, make sure you use the raw filter in your Twig template: `{{ entry.myRedactorField|raw }}`.  
  > **username_0**: All those settings (Remove inline styles, Remove empty tags, Replace non-breaking spaces with regular spaces, Purify HTML) were turned off, and we are using the raw filter for the output.  The `<p>` tags are injected by javascript in redactor, but not sent forward to craft when the entry is saved.  
  > **username_0**: I've also tried *with* all those settings checked... no difference  
  > **username_0**: Here's what I found I can do as a workaround:  -open the entry in the control panel -click preview -> content is bad (the <p> tags are in redactor, but not in the preview) -add a line of plain text to the content -click preview -> content is GOOD (and saves with newly added <p> tags)  
  
  ---
  
  