Expand my Community achievements bar.

SOLVED

<p> in richtext in touch UI

Avatar

Level 2

Hi Team,

I am getting <p> appending in all the times in Touch ui.

I followed the document to remove, but still getting <p> .

any suggestions to remove that.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Here's few thought:

I am assuming that you are referring to those <p> which are generated when you type something in RTE and view source edit.

The screenshot you shared is for format drop down you see in richtext and its has nothing to do with <p> tag generated

The default behavior of AEM generates those <p> tags and can only be removed if you author only one paragraph by adding property removeSingleParagraphContainer suggested above, how ever if you still want to removed those, I would suggest:

1. Customize RTE component and override this behavior.

2, Strip all <p> tags from the data you received from RTE in your JSP.

View solution in original post

7 Replies

Avatar

Level 10

Could you share the doc link which you followed and didn't worked ?

Avatar

Level 2

edubey wrote...

Could you share the doc link which you followed and didn't worked ?

 

https://docs.adobe.com/docs/en/aem/6-0/administer/operations/page-authoring/rich-text-editor.html#Ac...

Here is my dialog

 <rtePlugins jcr:primaryType="nt:unstructured">

                                                        <paraformat jcr:primaryType="nt:unstructured">

                                                            <formats jcr:primaryType="cq:widgetCollection">

                                                                <paragraph 

                                                                    jcr:primaryType="nt:unstructured"

                                                                    tag="p"

                                                                    description="Paragraph">

                                                                </paragraph>

                                                            </formats>

                                                        </paraformat>

                                                    </rtePlugins>

 

If i missed some thing in dialog, sorry please correct me.

Avatar

Level 10

Can you try adding  removeSingleParagraphContainer = true in you rte properties and the author one paragraph in rte to see results

Documentation link: http://docs.adobe.com/docs/en/cq/5-6-1/widgets-api/index.html?class=CQ.form.RichText

Avatar

Level 2

edubey wrote...

Can you try adding  removeSingleParagraphContainer = true in you rte properties and the author one paragraph in rte to see results

Documentation link: http://docs.adobe.com/docs/en/cq/5-6-1/widgets-api/index.html?class=CQ.form.RichText

 

i Changed but still am getting.

I attached my new dialog and nodes.

Please let me know if i need add some thing.

  <rtePlugins jcr:primaryType="nt:unstructured"

                                                    removeSingleParagraphContainer="true">

                                                            <paraformat

                                jcr:primaryType="nt:unstructured"

                                features="*">

                                <formats jcr:primaryType="cq:WidgetCollection">

                                    <p

                                        jcr:primaryType="nt:unstructured"

                                        description="p"

                                        tag="p"/>

                                    <h1

                                        jcr:primaryType="nt:unstructured"

                                        description="h1"

                                        tag="h1"/>

                                    <h2

                                        jcr:primaryType="nt:unstructured"

                                        description="h2"

                                        tag="h2"/>

                                    <h3

                                        jcr:primaryType="nt:unstructured"

                                        description="h3"

                                        tag="h3"/>

                                    <h4

                                        jcr:primaryType="nt:unstructured"

                                        description="h4"

                                        tag="h4"/>

                                </formats>

                            </paraformat>

                                                    </rtePlugins>[img]Screen Shot 2015-08-27 at 1.09.20 PM.png[/img]

Avatar

Correct answer by
Level 10

Here's few thought:

I am assuming that you are referring to those <p> which are generated when you type something in RTE and view source edit.

The screenshot you shared is for format drop down you see in richtext and its has nothing to do with <p> tag generated

The default behavior of AEM generates those <p> tags and can only be removed if you author only one paragraph by adding property removeSingleParagraphContainer suggested above, how ever if you still want to removed those, I would suggest:

1. Customize RTE component and override this behavior.

2, Strip all <p> tags from the data you received from RTE in your JSP.

Avatar

Community Advisor
Installation of a new paraformat option, and using Java Backend, Sling Model, we can text-transform the output, so that your Sightly HTL can render the output Html as expected. For the full tutorial you can find it here. 

Avatar

Community Advisor

Utilising the miscTools feature that the RTE provides, and along with the AEM Sling Model backend, removing the P tags can be done without a problem, 

 

Refer to this blog article for a full tutorial.

https://sourcedcode.com/blog/aem/aem-richtext-remove-p-tag-removesingleparagraphcontainer-for-touch-...