<p> in richtext in touch UI | Community
Skip to main content
Level 2
Oct 16, 2015 2:28 AM UTC
Solved

<p> in richtext in touch UI

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.
edubey
edubeyAccepted solution
Level 10
Oct 16, 2015 2:28 AM UTC

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

BrianKasingli
New Participant
Jan 10, 2022 9:46 PM UTC

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

 

Translate
BrianKasingli
New Participant
Oct 29, 2021 6:32 PM UTC
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. 
Translate
edubey
Level 10
Oct 16, 2015 2:28 AM UTC

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

Translate
seethananAuthor
Level 2
Oct 16, 2015 2:28 AM UTC

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.

Translate
edubey
Level 10
Oct 16, 2015 2:28 AM UTC

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

Translate
seethananAuthor
Level 2
Oct 16, 2015 2:28 AM UTC

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]

Translate
edubey
edubeyAccepted solution
Level 10
Oct 16, 2015 2:28 AM UTC

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.

Translate