Skip to main content
Level 4
Oct 26, 2021 5:10 PM UTC
Question

Richtext spell check save data without p tags

I have a dialog box 

<content
jcr:primaryType="nt:unstructured"
sling:resourceType="cq/gui/components/authoring/dialog/richtext"
removeSingleParagraphContainer="{Boolean}true"
useFixedInlineToolbar="{Boolean}true"
required="{Boolean}true"
fieldLabel="Content"
name="./content">
<rtePlugins jcr:primaryType="nt:unstructured" >
<htmlRules jcr:primaryType="nt:unstructured">
<blockHandling
jcr:primaryType="nt:unstructured"
removeSingleParagraphContainer="{Boolean}true"/>
</htmlRules>
<spellcheck
jcr:primaryType="nt:unstructured"
features="*"/>
</rtePlugins>
<uiSettings jcr:primaryType="nt:unstructured">
<cui jcr:primaryType="nt:unstructured">
<inline
jcr:primaryType="nt:unstructured"
toolbar="[spellcheck#checktext]">
</inline>
</cui>
</uiSettings>
</content>

I added this property removeSingleParagraphContainer="{Boolean}true" because it adding the data with p tags by default . After i added that property spell check doesn't work - It doesn't recognize the data entered - It always says no spelling issues found .. I am trying to have a spell check and save the data without p tags . Is there anything that needs to be modified or altered .. to make this work? 

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

4 replies

BrianKasingli
Adobe Champion and Community Advisor
Adobe Champion and Community Advisor
Oct 29, 2021 7:47 AM UTC

@aemnewbie,

There are many ways to tackle this problem, but here is one way to do it with Sling Models.

 

For Touch UI, You can create a custom paraformat option in the AEM Touch UI, cq/gui/components/authoring/dialog/richtext, and then using Java Backend, Sling Model, to 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.

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

 

Translate
AEMnewbieAuthor
Level 4
Nov 2, 2021 12:48 AM UTC

@briankasingli  Thats what i ended up doing .. I was just trying to see if this is something that could be controlled at the component level itself

Translate
BrianKasingli
Adobe Champion and Community Advisor
Adobe Champion and Community Advisor
Nov 2, 2021 1:47 AM UTC

Excellent, im glad that it worked out; unfortunately, there is no out of the box solution to fix this cause. A solution with javascript is just too troublesome. 

Translate