# Perspective Line Breaks in text label/markdown

**URL:** <https://forum.inductiveautomation.com/t/perspective-line-breaks-in-text-label-markdown/51715>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [October 7, 2021, 6:23pm UTC](https://forum.inductiveautomation.com/t/perspective-line-breaks-in-text-label-markdown/51715 "2021-10-07T18:23:11Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![laurie.croteau](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@laurie.croteau](https://forum.inductiveautomation.com/u/laurie.croteau)\
**Post date:** [October 7, 2021, 6:23pm UTC](https://forum.inductiveautomation.com/t/perspective-line-breaks-in-text-label-markdown/51715/1 "2021-10-07T18:23:11Z")

</div>

How to do line breaks in a text label in Perspective?

I try to replace “\n” by “\< b\>”(without space) in a script transform but it didn’t work, the is showing and doesn’t create a line break. I try Markdown component too but I have the same issue, I can’t have line break.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [October 7, 2021, 6:31pm UTC](https://forum.inductiveautomation.com/t/perspective-line-breaks-in-text-label-markdown/51715/2 "2021-10-07T18:31:12Z")

</div>

You will need to use a markdown component, the proper element however is `</br>`

Also, ensure you have set the escapeHtml property false.

---

<div class="post-metadata">

**Author:** ![laurie.croteau](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@laurie.croteau](https://forum.inductiveautomation.com/u/laurie.croteau)\
**Post date:** [October 7, 2021, 6:48pm UTC](https://forum.inductiveautomation.com/t/perspective-line-breaks-in-text-label-markdown/51715/3 "2021-10-07T18:48:56Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/2/d27ee0bfc9c76c5f6f0548d39e72c078a8b18557.png)  
I have set the escapeHtml property false and add `</br>` at the end of the line but do I need to do it in a script transform?

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [October 7, 2021, 7:02pm UTC](https://forum.inductiveautomation.com/t/perspective-line-breaks-in-text-label-markdown/51715/4 "2021-10-07T19:02:21Z")

</div>

If the text is changing then you would need to do this in a transform. If it is static then there wouldn’t be a need to do it in a script.

---

<div class="post-metadata">

**Author:** ![laurie.croteau](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@laurie.croteau](https://forum.inductiveautomation.com/u/laurie.croteau)\
**Post date:** [October 7, 2021, 7:06pm UTC](https://forum.inductiveautomation.com/t/perspective-line-breaks-in-text-label-markdown/51715/5 "2021-10-07T19:06:30Z")

</div>

Ok thanks I understand that part!  
But right now my Markdown as a Component Error, do you understand why?

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [October 7, 2021, 8:57pm UTC](https://forum.inductiveautomation.com/t/perspective-line-breaks-in-text-label-markdown/51715/6 "2021-10-07T20:57:03Z")

</div>

You need to also indicate where the html starts.

Put in opening and closing html tags:

```auto
<html>Your Text</br>should go here</html>

```

Note that you can not have any new lines in your text or this will also result in a component error.

---

<div class="post-metadata">

**Author:** ![zacht](https://avatars.discourse-cdn.com/v4/letter/z/ea5d25/32.png) [@zacht](https://forum.inductiveautomation.com/u/zacht)\
**Post date:** [October 7, 2021, 9:27pm UTC](https://forum.inductiveautomation.com/t/perspective-line-breaks-in-text-label-markdown/51715/7 "2021-10-07T21:27:29Z")

</div>

`</br>` may work, but I’ve always used `<br>` (no forward slash). This might be part of the problem.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 8, 2021, 12:15am UTC](https://forum.inductiveautomation.com/t/perspective-line-breaks-in-text-label-markdown/51715/8 "2021-10-08T00:15:03Z")

</div>

The official short tag is `<br/>`.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [October 8, 2021, 6:30am UTC](https://forum.inductiveautomation.com/t/perspective-line-breaks-in-text-label-markdown/51715/9 "2021-10-08T06:30:50Z")

</div>

you can also do this in labels/buttons ect.

look here and the quote i did there.

> [@New Feature: Perspective Tooltips](https://forum.inductiveautomation.com/t/new-feature-perspective-tooltips/49630/28):
>
> ah in a binding, you should be able to do that with a triple " (it will copy the tabs too tho so dont put a tab on the new line) multiLinestring=""" some multi line string""" return multiLinestring

---

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [February 15, 2024, 8:12am UTC](https://forum.inductiveautomation.com/t/perspective-line-breaks-in-text-label-markdown/51715/10 "2024-02-15T08:12:19Z")

</div>

> [@lrose](#):
>
> `<html>Your Text</br>should go here</html>`

@lrose

can you correct me what i am doing wrong in this script

```auto
if len(tag_check_neagtive) > 0:
    i = 0
    confirm = False	
    negative_message = 'This chart is unavailable for string type data. Please unselect the tags listed below from the Tag Tree Browser.'
    
    for y in tag_check_neagtive:
        negative_message += '<br>' + str(tag_check_neagtive[i])
        i += 1	
    
    system.perspective.openPopup("Warning", "test", 
                                 {"message": negative_message}, "Error", 
                                 modal=True, showCloseIcon=True, draggable=False, resizable=False)

```

output i am getting

This chart is unavailable for string type data. Please unselect the tags listed below from the Tag Tree Browser.  
[MQTT Engine]Edge Nodes//Electricity/Valid From

but i want output

This chart is unavailable for string type data. Please unselect the tags listed below from the Tag Tree Browser.  
[MQTT Engine]Edge Nodes//Electricity/Valid From

tag in next line

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [February 15, 2024, 8:48am UTC](https://forum.inductiveautomation.com/t/perspective-line-breaks-in-text-label-markdown/51715/11 "2024-02-15T08:48:03Z")

</div>

I can't see any difference between what you're getting and your wanted output. Can you edit your post to clarify?

---

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [February 15, 2024, 9:01am UTC](https://forum.inductiveautomation.com/t/perspective-line-breaks-in-text-label-markdown/51715/12 "2024-02-15T09:01:59Z")

</div>

> [@prasath.t](#):
>
> This chart is unavailable for string type data. Please unselect the tags listed below from the Tag Tree Browser.  
> [MQTT Engine]Edge Nodes//Electricity/Valid From

sorry i am getting output like this without line break  
This chart is unavailable for string type data. Please unselect the tags listed below from the Tag Tree Browser.[MQTT Engine]Edge Nodes//Electricity/Valid From

but i want  
This chart is unavailable for string type data. Please unselect the tags listed below from the Tag Tree Browser - single line  
and  
tag in another line  
[MQTT Engine]Edge Nodes//Electricity/Valid From

final output there should be break inbetween  
This chart is unavailable for string type data. Please unselect the tags listed below from the Tag Tree Browser  
[MQTT Engine]Edge Nodes//Electricity/Valid From

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [February 15, 2024, 9:11am UTC](https://forum.inductiveautomation.com/t/perspective-line-breaks-in-text-label-markdown/51715/13 "2024-02-15T09:11:18Z")

</div>

Have you got these settings set correctly?  
`markdown.escapeHtml : false`  
`markdown.skipHtml : false`

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [February 15, 2024, 11:47am UTC](https://forum.inductiveautomation.com/t/perspective-line-breaks-in-text-label-markdown/51715/14 "2024-02-15T11:47:41Z")

</div>

> [@prasath.t](#):
>
> ```auto
> for y in tag_check_neagtive:
> negative_message += '<br>' + str(tag_check_neagtive[i])
> i += 1
> 
> ```

There's no need for this tag\_check\_neagtive[i], this is your `y`. No need to use i at all

---

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [February 15, 2024, 12:17pm UTC](https://forum.inductiveautomation.com/t/perspective-line-breaks-in-text-label-markdown/51715/15 "2024-02-15T12:17:47Z")

</div>

I have used label previously.

now changed it to markdown and disbaled the settings what u given

working now thanks

---

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [February 15, 2024, 12:20pm UTC](https://forum.inductiveautomation.com/t/perspective-line-breaks-in-text-label-markdown/51715/16 "2024-02-15T12:20:19Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/5/35a26516fb1f2cf5ad779f0a52a6103bf0d7d83e.png)  
its automatically giving underline to mqqt/engine  
any way to remove it?

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [February 15, 2024, 12:47pm UTC](https://forum.inductiveautomation.com/t/perspective-line-breaks-in-text-label-markdown/51715/17 "2024-02-15T12:47:53Z")

</div>

Try using the preformatted HTML syntax, `<pre>...</pre>`.

```auto
Welcome to _Markdown_
<pre>[MQTT Engine]Edge Nodes/</pre>

```

with  
`markdown.escapeHtml : false`  
`markdown.skipHtml : false`

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [February 15, 2024, 12:58pm UTC](https://forum.inductiveautomation.com/t/perspective-line-breaks-in-text-label-markdown/51715/18 "2024-02-15T12:58:11Z")

</div>

You need to escape the bracket characters.

You can use the \<pre\> tag as @transistor shows but that changes the formatting, which means you might need to provide additional styling.

What is the actual type held in the `tag_check_negative` list. I see you're converting it to a string, does that mean its actually a list of TagPath objects? How are you obtaining the list?

---

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [February 15, 2024, 1:01pm UTC](https://forum.inductiveautomation.com/t/perspective-line-breaks-in-text-label-markdown/51715/19 "2024-02-15T13:01:45Z")

</div>

yes its tagpath so only i converting to str

---

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [February 15, 2024, 1:06pm UTC](https://forum.inductiveautomation.com/t/perspective-line-breaks-in-text-label-markdown/51715/20 "2024-02-15T13:06:05Z")

</div>

like this?  
`negative_message += '<pre>' + str(tag_check_neagtive[i]) + '</pre>'`

its not working same underline is showing

[Next page](https://forum.inductiveautomation.com/t/perspective-line-breaks-in-text-label-markdown/51715.md?page=2)
