Richtext spell check save data without p tags | Community
Skip to main content
Level 4
October 26, 2021
Question

Richtext spell check save data without p tags

  • October 26, 2021
  • 1 reply
  • 1267 views

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.

1 reply

BrianKasingli
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
October 29, 2021

@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

 

AEMnewbieAuthor
Level 4
November 2, 2021

@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

BrianKasingli
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
November 2, 2021

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.