WYSIWYG Field add paragraph tag automatically dotCMS

204 Views Asked by At

I have problem with WYSIWYG editor. It adds paragraph tag automatically on some places that I don't need paragraphs. Is there any option to turn off this setting in dotCMS or any other option to solve this problem?

Thank you!

2

There are 2 best solutions below

0
On

You can configure TinyMCE to do that. See:

http://www.tinymce.com/wiki.php/Configuration:forced_root_block

In dotCMS, will need to override the default tinymce config via a plugin: http://dotcms.com/docs/latest/controlling-tinymce-wysiwyg

0
On

Just in case if you don't want to go for tinymce plugin overriding, you can write a simple parser or a regex-matcher(for better performance) using a viewtool. This will take the WYSIWYG field value(code equivalent of it) as input and return your desired value after chopping off the paragraph tag.

This can give you a good control over the value generated by WYSIWYG field since you are sure about the wrapper tag i. e. paragraph tag