adobe / aem-boilerplate

Use this repository template for new AEM projects.
https://main--aem-boilerplate--adobe.aem.page
Apache License 2.0
126 stars 349 forks source link

Fragment block should retain authored classes #409

Open ujjwal5 opened 1 month ago

ujjwal5 commented 1 month ago

Expected Behaviour

Actual Behaviour

Reproduce Scenario (including but not limited to)

Steps to Reproduce

HTML changes

The HTML structure of the fragment block differs from other blocks. Typically, the structure follows: container → wrapper → block. However, for the fragment block, it only includes container → wrapper, omitting the block level.

With this update, classes defined in the referred fragment section, which was previously copied into the fragment block section, will remain in the referred fragment section. Further, all the referred fragment sections will now be copied under the fragment block, ensuring the same HTML DOM standards as other blocks.

Platform and Version

Verified with latest bolierplate code.

Sample Code that illustrates the problem

The problem is caused by this code section: https://github.com/adobe/aem-boilerplate/blob/main/blocks/fragment/fragment.js#L49-L52