Legacy Knowledge Base
Published Jul. 2, 2025

Fragment's content gets duplicated

Written By

Anishq Sharma

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • When trying to add a page fragment with HTML structure similar to below, the fragment's data gets duplicated after saving. Also, the data is no more editable.
<p>
<lfr-editable id="heading" type="rich-text">
Hii All!!
</lfr-editable>
</p>

Environment

  • Liferay DXP 7.0
  • Liferay DXP 7.1
  • Liferay DXP 7.2
  • Liferay DXP 7.3

Resolution

  • Actually, this is not a Liferay issue, but the HTML structure of the fragment.
  • By its nature, editable elements are being transformed into block elements(div) on rendering, <p> and <h1> elements mentioned in the issue are inline elements.
  • HTML standard doesn't allow to include block elements inside inline.
  • If the user still wants to have paragraphs or headers inside the editable, use "html" editable type.
  • As a workaround, use the <div> to surround the rich-text lfr-editable field and avoid using the <p> tag.
<div>
<lfr-editable id="heading" type="rich-text">
Hi All!!
</lfr-editable>
</div>

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base