OverviewStarting in 24.2, the Styled Text Editor Component is available directly in the product. Consider using this in place of the plug-in moving forward. For more information, review: https://docs.appian.com/suite/help/latest/Styled_Text_Editor_Component.html
Visit https://community.appian.com/w/the-appian-playbook/1378/end-user-rich-text-editor-component for more information. If you have any problems installing or using the component, please see the https://community.appian.com/w/the-appian-playbook/1603/rich-text-editor-component-plug-in-troubleshooting-guide
Key Features & Functionality
Supported Browsers: Chrome, Firefox, Edge, SafariSupported on Mobile
How can we remove extra spaces if added in rich text editor. We use a form layout and have this component. Even if no value is added by default it gets saved as "<div> </div>". If a user in UI just presses the space bar and enter and then space bars then also it is getting saved. We want to save the value only when there is a valid text value. We save it in rule input which is of type "text". Appian Version used in 21.1
You can use stripwith and striphtml to remove the HTML tags and spaces and check if there's any actual content.
For example, this will return false to indicate the local!data does not contain any actual content:
a!localVariables( local!data: "<div> </div>", local!content: stripwith( striphtml(local!data), char(10)&char(32)), a!isNotNullOrEmpty(local!content))
But this will return true to indicate there is actual text there:
a!localVariables( local!data: "<div>Some actual content </div>", local!content: stripwith( striphtml(local!data), char(10)&char(32)), a!isNotNullOrEmpty(local!content))