Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Richtext takes <div> after the <h3> Headline

Avatar

Level 1

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>

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

 

View solution in original post

9 Replies

Avatar

Correct answer by
Community Advisor

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

 

Avatar

Level 1
I added the file. My problem only happens when i make the Headline <h3> and then an "Enter" so if you can try to make a <h3> tag first ?

Avatar

Community Advisor
Which AEM instance version are you using?

Avatar

Community Advisor
The out of the box should be working as expected.

Avatar

Community Advisor

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

Avatar

Level 1
Yes, i have exact the same but the thing is that it writes a <div> tag and it is not defined, or i don't find the place where it is defined. Also it only writes a <div> after i use <h3>

Avatar

Community Advisor

Hi,

What is the AEM version that you are using?



Arun Patidar

Avatar

Level 1
Sorry i totally forgot to say which version, i'm using AEM 6.5

Avatar

Community Advisor
works for me as expected in 6.5


Arun Patidar