Skip to content

How to preserve /n in sap.m.Text #1973

@TinaC

Description

@TinaC

For <span>test \n\n\n test</span>, it showed in page:

image

But for <Text text="test \n\n\n test"/>, it showed as:

image

And \n is not preserved in HTML:

image

As the doc said, I added renderWhitespace="true", maxLines="0":

image

renderWhitespace="false", maxLines="1":
image

What if I want to show "test \n\n\n test" ?

Failed to find design purpose for renderWhitespace in https://github.com/SAP/openui5/blob/master/src/sap.m/src/sap/m/Text.js#L184

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions