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

As a developer, I would like an 'escape' attribute for <liferay-ui:icon>

    Details

      Description

      Currently, the message attribute in <liferay-ui:icon> is sometimes passed text that contains HTML and is sometimes passed text that was inputted by users. As a result, escape logic cannot be added inside <liferay-ui:icon>.

      Adding a escape attribute like we have in other taglib will allow a developer to turn off the escaping code in <liferay-ui:icon> if the message contains HTML code.

      The escape attribute should default to true.

      Test 1:

      String message = "Hello <b>World</b>";
      <liferay-ui:icon message="<%= message %>" escape="<%= true %>" ... />

      Output (visual): Hello <b>World</b>
      Output (HTML): Hello &lt;b&gt;World&lt;/b&gt;

      Test 2:

      String message = "Hello <b>World</b>";
      <liferay-ui:icon message="<%= message %>" escape="<%= false %>" ... />

      Output (visual): Hello World
      Output (HTML): Hello <b>World</b>

        Attachments

          Activity

            People

            • Assignee:
              support-lep@liferay.com SE Support
              Reporter:
              samuel.kong Samuel Kong
              Recent user:
              Samuel Kong
              Participants of an Issue:
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Packages

                Version Package