Closed mdasari84 closed 1 year ago
Hello @mdasari84 do you think you can use the Label web component (as we don't offer a Text web component - a counterpart of sap.m.Text) like that:
<ui5-label>Hello<br>World</ui5-label>
hi @ilhan007 ,
Thanks for the reply!
We need to replace \n (new line) with
World
We are looking for something like https://sapui5.hana.ondemand.com/#/entity/sap.m.FormattedText/sample/sap.m.sample.FormattedText (SAPUI5) control which supports certain tags.
Thanks, Madhu
Hello @mdasari84 sorry but I can't entirely understand the need for this component. In OpenUI5 we have the FormattedText because app developers do not have access to the DOM and can't write HTML in XML views, but in your case you can add whatever tags needed directly in your page without restriction.
Maybe you can give more details about the use-case, why you need a component like the Formatted Text Control, where you will use it and for what, so that I can understand the better the need.
Best, ilhan
hi @ilhan007 ,
Ok, got it. We need something that supports \n in the text like https://snippix.only.sap/#68876.
<ui5-label>Hello<br>World</ui5-label>
won't work because \n needs to be replaced with <br>
before rendering.
Thanks, Madhu
@ilhan007, would you please provide an update. Thanks!!
Hello, everyone! The issue has been inactive for 21 days. If there are still questions or comments, please feel free to continue the discussion. Inactive issues will be closed after 7 days!
@mdasari84, if the requirement is simply to transform new-line characters within already encoded HTML, then something like html.replace(/\n|\r\n?/g, '<br>')
would be a way to achieve the requirement.
Hello @mdasari84 is the request still relevant, does @stoehr's suggestion work for you?
Hello, everyone! The issue has been inactive for 21 days. If there are still questions or comments, please feel free to continue the discussion. Inactive issues will be closed after 7 days!
Hello, everyone! The issue has been inactive for 28 days, so I am closing the issue.
Feature Request Description
Support for \n (new line) in the Text web component.
Proposed Solution
We need something that SAPUI5 Text control already supports. Please check https://snippix.only.sap/#68876
Proposed Alternatives
No existing web component that supports \n
Additional Context
Add other context or screenshots related to the feature request here.
Priority
A clear and concise description of the impact/urgency of the required feature.
Stakeholder Info (if applicable)