adobe / aem-core-wcm-components

Standardized components to build websites with AEM.
https://docs.adobe.com/content/help/en/experience-manager-core-components/using/introduction.html
Apache License 2.0
742 stars 750 forks source link

[Embed] Empty `textarea` causes code leak #1585

Open tjameswhite opened 3 years ago

tjameswhite commented 3 years ago

Bug Report

Current Behavior Using Core Embed HTML option:

Expected behavior/code Expected to render an empty textarea. See normal-textarea.jpg screen shot.

Environment

Additional context / Screenshots Issue was reported by @anireddy on the AEM-Tech development Slack channel. (https://aem-tech.slack.com/archives/C3F6CM48Y/p1621455300006600) If the <textarea> is not empty it renders correctly. But if empty the error occurs. So while the above breaks this works: <textarea name="name" rows="10" cols="40">@nbsp;</textarea>

Additionally, once the component breaks, it is not authorable.

Author: embed-textarea-author

View as Pub: embed-textarea-view-as-pub

Expected: normal-textarea

msagolj commented 3 years ago

@adobe export issue to Jira Project SITES as Bug

github-jira-sync-bot commented 3 years ago

:white_check_mark: Jira issue SITES-898 is successfully created for this GitHub issue.

raducotescu commented 3 years ago

This seems to happen because of how AntiSamy is configured by default in AEM, specifically the useXHTML option which is set to true. Setting this to false makes the empty textarea render correctly.