Search code examples
markdownzendesk

How to use the \n newline symbol in markdown to push text to next line?


I'm about to submit an application to Zendesk, however, they require you to create a description for the application and they mention you can use Markdown to style it. The object I would submit with that information looks like this:

"app": {
    "name": "Application Name",
    "long_description": ""
}

And I need to set long_description to the Markdown. Now here's my issue - let's say I want the following 2 sentences like this:

Welcome to Application Name

Explanation about the application

I want them to have a new line between the 2 sentences and Zendesk says that I must use \n to achieve that, but they don't show any examples and there's no preview of how the application description would look like before uploading it, so I have to guess.

Do I need to set long_description to "Welcome to Application Name\nExplanation about the application" in order to achieve that space between the lines? I looked up Markdown's documentation and didn't really see \n symbol being used anywhere, so I'm a bit confused.


Solution

  • Do I need to set long_description to "Welcome to Application Name\nExplanation about the application" in order to achieve that space between the lines?

    Yes, that is probably correct. I think the thing you might be missing is that the \n is part of JSON, rather than markdown. So a JSON string like

    "Welcome to Application Name\nExplanation about the application"
    

    gets translated into the markdown string

    Welcome to Application Name
    Explanation about the application
    

    As a side note, you may need multiple \n characters between the two lines - some flavors of markdown treat a single line break as continuing the same line.