"\n" is not working properly | Community
Skip to main content

"\n" is not working properly

  • September 28, 2021
  • 3 replies
  • 0 views

Hello I'm trying to make a zendesk ticket via zendesk api with Google Apps Scripts.

I made a message body to post but "\n" is not working properly when it's posted.

For example, I make the following message body.

  "This is a first line of the ticket","\n",
  "This is a second line of the ticket","\n"
Then I expect it to come out like below
  This is a first line of the ticket
  This is a second line of the ticket
But what I actually get is
  This is a first line of the ticket
 
  This is a second line of the ticket
 
I don' need an empty row in between but it shows that way.
I've checked html but there is only one <br> in between.
I'd like to know the reason why this happens.
Thanks.
 
 

3 replies

Eric27
  • September 30, 2021

Hey Seonok,

Can you provide your script so we can take a look?

Have a wonderful day!

Eric Nelson | Manager - Developer Advocacy


  • January 26, 2022

Hello. Did you get this to work?

I'm trying to implement https://codepen.io/atnyman/pen/gabGXV but the markdown code in the article editor changes from

<div class="mermaid">
sequenceDiagram
participant System
participant App
System->>App: Do you hear me
App-->>Module: Alive?
Module-->>App: Yay!
App->>System: Stop
</div>

to

<div class="mermaid">
sequenceDiagram participant System participant App System-&gt;&gt;App: Do you
hear me App--&gt;&gt;Module: Alive? Module--&gt;&gt;App: Yay! App-&gt;&gt;System:
Stop
</div>

which prevents the script from working properly.


  • August 25, 2022

Answering myself here. The solution is to use this code

 

<pre class="mermaid">sequenceDiagram 
  autonumber
 participant HOST
  participant System Manager
  participant CVC
  participant PLC
  HOST-&gt;&gt;System Manager: Order start _q
...