How to Insert a Line Break in a String in Perspective

Text displayed in the web is almost always sanitized for safety and security reasons and perspective is no different there. The text you set as a prop (with very specific exceptions such as in the markdown component) is never submitted to the page as interpretable markup. Doing so would open up all kinds of security risks and injection opportunities.

While the markdown component does provide the ability to allow markup, I’d be careful allowing it due to the potential risks involved.

In your example, I’d suggest simply using 3 labels. If you want the convenience of a single expression and consistent layout, I’d suggest creating a ‘view component’ with 3 labels and appropriate formatting, with an input parameter if you want to pass values in.

2 Likes