Richtext takes <div> after the <h3> Headline

Avatar

Avatar

xerxes1

Avatar

xerxes1

xerxes1

08-01-2021

There are Paraformats like <p>, <h1>, <h2>, <h3> etc.

We are using the <p> tag as "standart" and the <h3> tag as "Headline" and the rest ist disabled.

When i say a line is "Headline" and then i click "Enter" the new line should be a <p> tag but it is creating a <div> tag.

Also when i want to change this <div> line to the "Standart" paraformat, the button is disabled.

I want that it is creating a <p> and not a <div> but i can't find from where the <div> is coming from and how i fix it ?


Here the HTML value:

 

<p>some text</p>
<h3>asdf<br>
</h3>
<div>asdf</div>

 

 

In the Image you can see how the button is grey when i want to change the <div> but when i click somewhere else in the text with no <div> the button can be clicked:

Unbenannt.PNG

 

Here is the _cd_dialog file, maybe it helps:

 

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
          xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
          jcr:primaryType="nt:unstructured"
          jcr:title="Text"
          sling:resourceType="cq/gui/components/authoring/dialog">
    <content
            jcr:primaryType="nt:unstructured">
        <items jcr:primaryType="nt:unstructured">
            <tabs
                    jcr:primaryType="nt:unstructured">
                <items jcr:primaryType="nt:unstructured">
                    <properties
                            jcr:primaryType="nt:unstructured">
                        <items jcr:primaryType="nt:unstructured">
                            <columns
                                    jcr:primaryType="nt:unstructured">
                                <items jcr:primaryType="nt:unstructured">
                                    <column
                                            jcr:primaryType="nt:unstructured">
                                        <items jcr:primaryType="nt:unstructured">
                                            <text
                                                    jcr:primaryType="nt:unstructured"
                                                    sling:resourceType="cq/gui/components/authoring/dialog/richtext"
                                                    name="./text"
                                                    useFixedInlineToolbar="{Boolean}true">
                                                <rtePlugins jcr:primaryType="nt:unstructured"
                                                            sling:resourceSuperType="/mnt/override/apps/websitename/components/content/text/cq:editConfig/cq:inplaceEditing/inplaceEditingConfig/rtePlugins">
                                                    <paraformat
                                                            jcr:primaryType="nt:unstructured"
                                                            features="*">
                                                        <formats jcr:primaryType="nt:unstructured">
                                                            <default_p
                                                                    jcr:primaryType="nt:unstructured"
                                                                    description="Standard"
                                                                    tag="p"/>
                                                            <default_h1
                                                                    jcr:primaryType="nt:unstructured"
                                                                    sling:hideResource="true"/>
                                                            <default_h2
                                                                    jcr:primaryType="nt:unstructured"
                                                                    sling:hideResource="true"/>
                                                            <default_h3
                                                                    jcr:primaryType="nt:unstructured"
                                                                    description="Headline"
                                                                    tag="h3"/>
                                                            <default_h4
                                                                    jcr:primaryType="nt:unstructured"
                                                                    sling:hideResource="true"/>
                                                            <default_h5
                                                                    jcr:primaryType="nt:unstructured"
                                                                    sling:hideResource="true"/>
                                                            <default_h6
                                                                    jcr:primaryType="nt:unstructured"
                                                                    sling:hideResource="true"/>
                                                            <default_blockquote
                                                                    jcr:primaryType="nt:unstructured"
                                                                    sling:hideResource="true"/>
                                                            <default_hr
                                                                    jcr:primaryType="nt:unstructured"
                                                                    sling:hideResource="true"/>
                                                            <default_pre
                                                                    jcr:primaryType="nt:unstructured"
                                                                    sling:hideResource="true"/>
                                                        </formats>
                                                    </paraformat>
                                                </rtePlugins>
                                                <uiSettings jcr:primaryType="nt:unstructured"
                                                            sling:resourceSuperType="/mnt/override/apps/websitename/components/content/text/cq:editConfig/cq:inplaceEditing/inplaceEditingConfig/uiSettings">
                                                    <cui jcr:primaryType="nt:unstructured">
                                                        <inline
                                                                jcr:primaryType="nt:unstructured"
                                                                toolbar="[subsuperscript#subscript,subsuperscript#superscript,edit#paste-plaintext,edit#paste-wordhtml,links#modifylink,links#unlink,findreplace#find,findreplace#replace,undo#undo,undo#redo,#lists,table#createoredit,#justify,spellcheck#checktext,misctools#specialchars,misctools#sourceedit,#paraformat,#styles,tooltip#tooltip,telephonelink#telephonelink]">
                                                            <popovers jcr:primaryType="nt:unstructured">
                                                                <justify
                                                                        jcr:primaryType="nt:unstructured"
                                                                        items="[justify#justifyleft,justify#justifycenter,justify#justifyright]"
                                                                        ref="justify"/>
                                                                <lists
                                                                        jcr:primaryType="nt:unstructured"
                                                                        items="[lists#unordered,lists#ordered,lists#outdent,lists#indent]"
                                                                        ref="lists"/>
                                                                <paraformat
                                                                        jcr:primaryType="nt:unstructured"
                                                                        items="paraformat:getFormats:paraformat-pulldown"
                                                                        ref="paraformat"/>
                                                                <styles
                                                                        jcr:primaryType="nt:unstructured"
                                                                        items="styles:getStyles:styles-pulldown"
                                                                        ref="styles"/>
                                                            </popovers>
                                                        </inline>
                                                    </cui>
                                                </uiSettings>
                                                <htmlRules jcr:primaryType="nt:unstructured"
                                                           sling:resourceSuperType="/mnt/override/apps/websitename/components/content/text/cq:editConfig/cq:inplaceEditing/inplaceEditingConfig/htmlRules">
                                                </htmlRules>
                                            </text>
                                            <id
                                                    jcr:primaryType="nt:unstructured"
                                                    sling:hideResource="true"/>
                                        </items>
                                    </column>
                                </items>
                            </columns>
                        </items>
                    </properties>
                </items>
            </tabs>
        </items>
    </content>
</jcr:root>

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

BrianKasingli

MVP

Avatar

BrianKasingli

MVP

BrianKasingli
MVP

08-01-2021

@xerxes1,

I have tested the RichText editor with all enabled features, and have no headings (h2,h3,h3) selected. On AEM 6.5, Everything is working as expected here. You can find my the component that I have tested here, https://gist.github.com/briankasingli/1a7e3e12deaa2e076645b09d30039b46

Take a look at my screenshot, the view source code looks like it's working as expected. 

BrianKasingli_1-1610107669008.png

Maybe what you can do is share your _cq_dialog.xml configuration with us, so we can further investigate your situation.

 

Answers (2)

Answers (2)

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

3.0K

Likes

1.1K

Correct Reply

840

Avatar

Arun_Patidar

MVP

Total Posts

3.0K

Likes

1.1K

Correct Reply

840
Arun_Patidar
MVP

08-01-2021

Hi,

What is the AEM version that you are using?

Avatar

Avatar

TUmesh

Avatar

TUmesh

TUmesh

08-01-2021

Hi @xerxes1,

Under the paraformat node you will have some formates nodes there usually we have the name and its equivalent HTML tag. At the same place you can see and update it.

TUmesh_0-1610107732133.png

Hope this will help.

Umesh Thakur