-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 7.1.X, Master
-
Component/s: Dynamic Data Mapping > Template Editor
-
Labels:
-
Branch Version/s:7.1.x
-
Backported to Branch:Committed
-
Story Points:0.25
-
Fix Priority:3
-
Sprint:F&W Sprint 8, F&W Sprint 9
-
Git Pull Request:
Summary
If self-closing tags (e.g. <hr />) are present, any code that follows the self-closing tag will be minified or consolidated into a single line. This seems to happen on all template editors that are present in Liferay, such as DDM Template and ADT editor.
Steps to Reproduce (Example in ADT, but happens in other template editors such as WCM Template editor)
- Product Menu > Liferay DXP > Build > Application Display Templates
- Add a new template (any template is fine)
- Add a title, and add the following:
<hr /> <#if entries?has_content> <div class="row"> <#list entries as curEntry> <#assign curEntry = curEntry assetRenderer = curEntry.getAssetRenderer() blogEntry = assetRenderer.getAssetObject() entryTitle = htmlUtil.escape(assetRenderer.getTitle(locale)) viewURL = assetPublisherHelper.getAssetViewURL(renderRequest, renderResponse, curEntry) /> <div class="col-md-4 entry-card lfr-asset-item"> <div class="card-type-asset form-check form-check-card form-check-top-left image-card"> <div class="container-fluid container-fluid-max-sm"> <div class="card card-type-asset"> <div class="aspect-ratio card-item-first"> <a href="${viewURL}"> <img alt="Cover Image" class="aspect-ratio-item aspect-ratio-item-center-middle" src="${blogEntry.getCoverImageURL(themeDisplay)}" style="max-height:100%;"> </a> </div> <div class="card-body"> <div class="card-row"> <div class="autofit-col autofit-col-expand"> <h3 class="card-title"> <a href="${viewURL}">${entryTitle}</a> </h3> <div class="card-subtitle" title="Author Action">${blogEntry.getDisplayDate()?date}</div> </div> </div> </div> </div> </div> </div> </div> </#list> </div> </#if>
- Save
- Edit
Actual Results
Assert that all of the code is now on one line.
Expected Results
Despite the presence of a self-closing tag, code structure should be retained.
Reproduced in
7.1.x Private Commit: 40d9e186b7f81ae2c027e7e89fdb1ad890d6eb9f
- causes
-
LPS-106476 Double horizontal ruler appears on New ADT Template form
- Closed
- is duplicated by
-
LPS-86063 7.1 DXP: Web Content Templates: FreeMarker code gets displayed into 1 line
- Closed
- is related to
-
LPS-84791 ADT Editor is stripping all line breaks after first tag that self-closes
- Verified