2906
Views
15
Comments
Solved
[CKEditor] How to remove tags from the output of CK editor?
Question
Forge component by Matthias Preuter
29
Published on 25 Aug 2020

Hi Everyone,

I am creating a mail component ot send mail to the users. For that, I used CK editor component to input the content of the mail. When i am sending the mail , the contents are added with <p> tags. 

How to remove it? Please help!!!




The mail i am getting with <p> tags.


mvp_badge
MVP
Rank: #2
Solution

Hi Ananth,

This Stack Overflow article might be of help (note that was the very first Google hit of my search, Google is your friend!).

Rank: #4610

Kilian Hekhuis wrote:

Hi Ananth,

This Stack Overflow article might be of help (note that was the very first Google hit of my search, Google is your friend!).

Thanks Kilian,

I have added this in the config parameter, now I am not getting that irritating <p> tags.
config.autoParagraph = false


mvp_badge
MVP
Rank: #2

Cool it works Ananth! Happy coding :)

Rank: #883

Hi, After putting autoParagraph = false. It's also removing Tollbar. Which I don't Want. Can anyone help on this?

mvp_badge
MVP
Rank: #2

Hi Arvind,

I'm pretty sure it isn't removing the toolbar because of that statement. Did you malformat anything? Can you share some code?

Rank: #883

config code

SyntaxEditor Code Snippet

"toolbar:[
        ['Bold','Italic','Underline', 'Strike','Subscript','Superscript'],
        ['NumberedList','BulletedList','-','Outdent','Indent'],
        ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock', '-', 'Table'],
        ['Styles','Format','Font','FontSize'],
        ['autoParagraph' = False],
    ]"
mvp_badge
MVP
Rank: #2

Hi Arvind,

Why on earth are you adding the autoParagraph option to the toolbar????

Rank: #883

Hi, In Config parameter Another developer already added code.  P tag appearing so now I am working to Fix it. Anyway to fix from here ? Not sure why Auto paragraph removing all other settings. Any option to Fix from here ?

Thanks in advance.

mvp_badge
MVP
Rank: #2

Arvind,

If I had to guess, autoParagraph removes all the other settings because it is an invalid option in a toolbar. It has nothing to do with the toolbar, at all! So CKE parses the toolbar options, finds an illegal option and gives up, not parsing or setting anything else.

The right way to set the option is, like the link I posted above says, add

CKEDITOR.config.autoParagraph = false;

to your code. Again, it has nothing to do with the toolbar. You can't just randomly put things somewhere.

Rank: #883

Thanks for the information.

Rank: #15089

Hello,

I have a site property with the ckeditor config:


My site property is like this:


SyntaxEditor Code Snippet

"toolbar:[
['Cut', 'Copy', 'Paste', '-', 'Undo', 'Redo'], ['Link','Unlink'], ['Table', 'HorizontalRule', 'SpecialChar'], '/',
['FontSize'], ['Bold','Italic','Underline'], 
['NumberedList','BulletedList','Outdent','Indent','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], 
['TextColor','BGColor'], 
['Font', 'Styles', 'Format']
]

config.autoParagraph = false;"


but this do not work.

Whats the correct sintax to hide it?



In case you are still looking for help, the correct format would be: 

"toolbar:[
['Cut', 'Copy', 'Paste', '-', 'Undo', 'Redo'], ['Link','Unlink'], ['Table', 'HorizontalRule', 'SpecialChar'], '/',
['FontSize'], ['Bold','Italic','Underline'], 
['NumberedList','BulletedList','Outdent','Indent','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], 
['TextColor','BGColor'], 
['Font', 'Styles', 'Format']
],

autoParagraph: false,"


But I think autoParagraph is deprecated as I'm not finding it in the documentation. Instead, try 

enterMode: 2,
Rank: #947

How can i remove auto-paragraph in the CKeditor?

In the web, it suggest to use the below command. However, i don't how to do it outsystems. Please advise

CKEditor.config.autograph = false;
Rank: #111

Hi,

Below is what I did in demo app for cfg_wcount assignment, I added three configuration

  1. autoParagraph: false
  2. enterMode: 2 (means it will insert <br> when you hit enter key_
  3. ShiftEnterMode: 1 (means it will insert <p> when you kit shit+enter key)

Regards.

Rank: #947

Thank Prasad.

It works.