2

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

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).

| improve this answer | |
  • Also, make sure you use the raw filter in your Twig template: {{ entry.myRedactorField|raw }}. – lemp Jun 4 at 20:33
  • 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. – Mark Middleton Jun 4 at 20:40
  • I've also tried with all those settings checked... no difference – Mark Middleton Jun 4 at 20:45
  • 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) – Mark Middleton Jun 4 at 22:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.