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
to
Any other ideas of how to fix this? It is really frustrating.
replaceDivs:!0,paragraphize:!0
to
replaceDivs:!1,paragraphize:!1
Any other ideas of how to fix this? It is really frustrating.
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.
Any other ideas?
Hey,
Its only stop the replacing DIV with P.
but if you add any sentence with without any element it will wrap with P tags
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
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>
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?
I ended up going with CK Editor and here is how to fix it:
open CKEditor.php (/src/Editor)
look for this code block
add these two key value pairs
the code should look like this afterward
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'
Viewing 15 lines of 18 lines. View entire code block.
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'
Viewing 15 lines of 20 lines. View entire code block.
After changing in js , did you clear the cache ?
Please do and check again.
Thanks