<p>I just found the following in the updated docs for the <a href="https://imperavi.com/redactor/docs/settings/keypress/#setting-enterKey" rel="nofollow"><code>enterKey</code> setting</a>:</p>

<blockquote>
  <p>enterKey — This setting allows to prevent use of Return key.
  With this set to 'false' and pastePlainText is set to true, line breaks will be replaced by spaces.</p>
</blockquote>

<p>So make sure you are on Craft 2.5.2757, as it includes <a href="https://imperavi.com/redactor/log" rel="nofollow">Redactor II 1.2</a> which has got the <a href="https://imperavi.com/redactor/docs/settings/paste/" rel="nofollow">new paste settings</a> and try this Redactor config:</p>

<pre><code>"enterKey": false,
"pastePlainText": true,
</code></pre>

<p>Redactor II deprecated the <code>paragraphize</code> setting, but as noted in the comments, it's easy to remove HTML tags with the <a href="http://twig.sensiolabs.org/doc/filters/striptags.html" rel="nofollow"><code>striptags</code></a> filter:</p>

<pre><code>{{ asset.caption|striptags('&lt;em&gt;&lt;strong&gt;')|raw }}
</code></pre>

<p>Every tag listed in the param string is whitelisted and won't get removed.</p>

CC BY-SA 3.0
2016-01-12T12:40:13.450Z
2016-02-19T19:26:00.027Z
2016-02-19T19:26:00.027Z
carlcs
<p>I realize Craft 2.5 ships with Redactor II which has many changes.</p>

<p>With Redactor I a combination of </p>

<pre><code>paragraphize: false,
replaceDivs: false,
linebreaks: true,
enterKey: false
</code></pre>

<p>kept text from being wrapped in <code>p</code> tags.</p>

<p>I want to give someone the ability to add simple formatting such as bold and italic, but not wrap it in any HTML.</p>

<p>Has anyone found how to continue doing this with Redactor II?</p>

<p>Thanks.</p>

CC BY-SA 3.0
2015-12-13T09:50:35.690Z
+1. Redactor 2 seems completely useless for copy/pasting in large bodies of text, mainly because it completely strips away paragraphs! If anyone has a fix for this I'd be very grateful.
Jamie Wade
CC BY-SA 3.0
2016-01-03T19:39:21.960Z
Not an answer, but [I wrote a plugin](https://github.com/mmikkel/RetconHTML-Craft/wiki/Unwrap) which will at least enable you to easily remove the `<p>` tags when the field is output in Twig: `{{ entry.body|retconUnwrap('p') }}`
Mats Mikkel Rummelhoff
CC BY-SA 3.0
2016-01-05T17:12:58.127Z
I am having this same issue. I guess the plugin will work for now, but has anyone found a way to do it natively? Redactor 2 has definitely been a frustrating "upgrade" to say the least. :-/
Jacob Graf
CC BY-SA 3.0
2016-01-05T17:27:44.700Z
Had the same dilemma. I currently went with using Twigs [striptags filter](http://twig.sensiolabs.org/doc/filters/striptags.html), which allows you to whitelist allowed tags. Example: `heading|striptags('<strong>, <em>')|raw`
Pascal Mollet
CC BY-SA 3.0
2016-01-05T22:03:37.320Z
Another viable workaround: P&T released a plugin a while back which makes it possible to continue using Redactor I with Craft 2.5+: https://github.com/pixelandtonic/RedactorI
Mats Mikkel Rummelhoff
<redactor>
Redactor II Craft 2.5 Prevent Paragraphs
# Redactor II Craft 2.5 Prevent Paragraphs

(Asked by: username_0 on 2015-12-13)

I realize Craft 2.5 ships with Redactor II which has many changes.
With Redactor I a combination of 
paragraphize: false,
replaceDivs: false,
linebreaks: true,
enterKey: false

kept text from being wrapped in p tags.
I want to give someone the ability to add simple formatting such as bold and italic, but not wrap it in any HTML.
Has anyone found how to continue doing this with Redactor II?
Thanks.

**Tags:** redactor

> **Comments:**
> **username_1**: +1. Redactor 2 seems completely useless for copy/pasting in large bodies of text, mainly because it completely strips away paragraphs! If anyone has a fix for this I'd be very grateful.  
> **username_2**: Not an answer, but [I wrote a plugin](https://github.com/mmikkel/RetconHTML-Craft/wiki/Unwrap) which will at least enable you to easily remove the `<p>` tags when the field is output in Twig: `{{ entry.body|retconUnwrap('p') }}`  
> **username_3**: I am having this same issue. I guess the plugin will work for now, but has anyone found a way to do it natively? Redactor 2 has definitely been a frustrating "upgrade" to say the least. :-/  
> **username_4**: Had the same dilemma. I currently went with using Twigs [striptags filter](http://twig.sensiolabs.org/doc/filters/striptags.html), which allows you to whitelist allowed tags. Example: `heading|striptags('<strong>, <em>')|raw`  
> **username_2**: Another viable workaround: P&T released a plugin a while back which makes it possible to continue using Redactor I with Craft 2.5+: https://github.com/pixelandtonic/RedactorI  

---

## 1 answers

### Answer by username_5 on 2016-01-12. Score: 4

I just found the following in the updated docs for the enterKey setting:

enterKey — This setting allows to prevent use of Return key.
  With this set to 'false' and pastePlainText is set to true, line breaks will be replaced by spaces.

So make sure you are on Craft 2.5.2757, as it includes Redactor II 1.2 which has got the new paste settings and try this Redactor config:
"enterKey": false,
"pastePlainText": true,

Redactor II deprecated the paragraphize setting, but as noted in the comments, it's easy to remove HTML tags with the striptags filter:
{{ asset.caption|striptags('')|raw }}

Every tag listed in the param string is whitelisted and won't get removed.


---

