<p> in richtext in touch UI | Community
Skip to main content
Level 2
October 16, 2015
Solved

<p> in richtext in touch UI

  • October 16, 2015
  • 7 replies
  • 8136 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by edubey

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.

7 replies

edubey
Level 10
October 16, 2015

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

seethananAuthor
Level 2
October 16, 2015

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#Activating%20a%20Plugin

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.

edubey
Level 10
October 16, 2015

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

seethananAuthor
Level 2
October 16, 2015

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]

edubey
edubeyAccepted solution
Level 10
October 16, 2015

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.

BrianKasingli
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
October 29, 2021
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. 
BrianKasingli
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
January 10, 2022

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-...