Known Issue: <form> tag is removed in Alloy Editor

This article describes a known limitation visible in the Alloy Editor as documented in LPS-71067.

When using the editor's source mode and entering a <form> tag, the editor will remove it upon switching back to Alloy Editor's WYSIWYG or publishing the content.

Root Cause

The root cause of this issue is that, as indicated in the HTML specification at https://www.w3.org/TR/html4/interact/forms.html#h-17.3, a <form> tag cannot be nested inside another one. Because Liferay DXP is attempting to do this, the browser itself will filter the tag out.

The Alloy Editor works in "inline" mode and is itself wrapped inside a <form> tag in the page. This will lead the browser to "fix" the HTML and strip down the "extra" <form> tag.

Resolution

Status: Workaround Available

To work around the limitation, you may switch from Alloy Editor to CKEditor by setting

editor.wysiwyg.portal-impl.portlet.ddm.text_html.ftl=ckeditor

in the portal-ext.properties file of the affected Liferay instance.

Although the unwanted behavior is rooted at browser level, CKEditor on DXP operates in "iframe" mode, therefore the issue will not be triggered.

Additional Information

CKEditor and Alloy Editor are provided as WYSIWYG Content Editors and are not intended to be HTML Editors. These editors' Source Modes are provided for convenience and are only intended for minor markup adjustments. Any markup entered into Source Mode is not guaranteed to remain unmodified nor intact.

Resolving this known issue on Alloy Editor at the root should imply modifying the embedding architecture of Alloy Editor in DXP. As an API-breaking change, in order to preserve the stability of the Liferay General Availability releases, the new potential solution may only appear in future Liferay versions

Liferay Front-end engineering is aware of the issue and will take it into consideration when working in future Liferay implementations. Please see the New Feature Implementation article for all details.

Was this article helpful?
0 out of 0 found this helpful