Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-84564

If self-closing tags are present in freemarker code, any code following it becomes minified into one line

    Details

      Description

      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)

      1. Product Menu > Liferay DXP > Build > Application Display Templates
      2. Add a new template (any template is fine)
      3. 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>
      4. Save
      5. 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

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  49 weeks, 2 days ago

                  Packages

                  Version Package
                  Master