Stopping Redactor From Inserting Paragraph Tags

Permalink
I am trying to get Redactor to stop from adding <p> tags when using the content block. I have read many posts includinghttps://www.concrete5.org/community/forums/5-7-discussion/div-replac... and I just can't seem to get it to work. Most recently I tried making a copy of /concrete/js/redactor.js and moving it to /application/js/redactor.js. Then changing

replaceDivs:!0,paragraphize:!0

to
replaceDivs:!1,paragraphize:!1


Any other ideas of how to fix this? It is really frustrating.

keydin
 
andrewjaff replied on at Permalink Reply
andrewjaff
Hi,

After changing in js , did you clear the cache ?

Please do and check again.

Thanks
keydin replied on at Permalink Reply
keydin
Yes I did. The weird thing is that when I try to use a different wysiwyg editor, community_ckeditor and change the setting in the config.js (and clear the cache) it doesn't fix it in that editor either.
keydin replied on at Permalink Reply
keydin
Any other ideas?
andrewjaff replied on at Permalink Reply
andrewjaff
Hey,

replaceDivs:!1


Its only stop the replacing DIV with P.

but if you add any sentence with without any element it will wrap with P tags
keydin replied on at Permalink Reply
keydin
Yep. I was just trying cover all my bases. I also changed the paragraphize parameter which is supposed to stop the adding of the <p>
keydin replied on at Permalink Reply
keydin
Since I have tried the recommended adjustments in both redactor and community_ckeditor, and still having the same issue, it makes me wonder if the problem is outside of these two plugins. Somewhere in the core?
keydin replied on at Permalink Best Answer Reply
keydin
I ended up going with CK Editor and here is how to fix it:

open CKEditor.php (/src/Editor)

look for this code block

$options = array_merge(
$options,
array(
    'plugins' => implode(',', $plugins),
    'stylesSet' => 'concrete5styles',
    'filebrowserBrowseUrl' => 'a',
    'uploadUrl' => (string)URL::to('/ccm/system/file/upload'),
    'language' => $this->getLanguageOption(),
    'customConfig' => '',
    'allowedContent' => true,
    'image2_captionedClass' => 'content-editor-image-captioned',
    'image2_alignClasses' => array(
        'content-editor-image-left',
        'content-editor-image-center',
        'content-editor-image-right'

add these two key value pairs

'enterMode' => 2,
'shiftEnterMode' => 2


the code should look like this afterward

$options = array_merge(
$options,
array(
    'plugins' => implode(',', $plugins),
    'stylesSet' => 'concrete5styles',
    'filebrowserBrowseUrl' => 'a',
    'uploadUrl' => (string)URL::to('/ccm/system/file/upload'),
    'language' => $this->getLanguageOption(),
    'customConfig' => '',
    'allowedContent' => true,
    'image2_captionedClass' => 'content-editor-image-captioned',
    'image2_alignClasses' => array(
        'content-editor-image-left',
        'content-editor-image-center',
        'content-editor-image-right'