If I use a SINGLE enter, it gets removed for some dumb reason (for “space efficiency”, my ass).

If I use TWO enters:

Like this, they stay.

What if I want to list things directly under each other? My only choice would be to use TWO enters and waste even more space.

Why not just respect the single and double use of enters? Unnecessary formatting!!!

  • 𝘋𝘪𝘳𝘬@lemmy.ml
    link
    fedilink
    arrow-up
    68
    ·
    edit-2
    3 days ago

    It’s Markdown syntax. Single newlines are ignored so the text can be styled to be 80 characters wide for example but still have it rendered with another line length while two newlines result in a new paragraph. It’s not about “space efficiency”.

    To get a visible linebreak without creating a paragraph, add two spaces at the end of the line you want to break.

    hello↵
    ↵
    this is the first line␣␣↵
    this is the second line↵
    ↵
    more text here
    

    … results in this:


    hello

    this is the first line
    this is the second line

    more text here


    (Actual rendering depends on your renderer.)

    • ValiantDust@feddit.org
      link
      fedilink
      arrow-up
      35
      ·
      3 days ago

      You can also use a backslash instead of two spaces. For example, if your phone keyboard converts double space-presses to a period and you are too impatient to do them more slowly (definitely not me).

      Just add a backslash\
      for a new line
      

      results in:

      Just add a backslash
      for a new line

      • sbird@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        2
        ·
        2 days ago

        Not sure about Android (but if you can swap out your keyboard entirely on Android, you probably can) but on iOS you can disable the double press to create a period! It’s in there with the keyboard settings next to the options to disable stuff like autocorrect

        • ValiantDust@feddit.org
          link
          fedilink
          arrow-up
          2
          ·
          edit-2
          2 days ago

          Yes, I can disable it. But I’m actually using the feature. Which probably contributes to the problem, because muscle memory makes me double press too fast.

  • da_cow (she/her)@feddit.org
    link
    fedilink
    arrow-up
    19
    arrow-down
    2
    ·
    2 days ago

    Its very simple you have to add three whitespaces to the end of the line and then add the line break.

    Like this:
    New Line

      • tigeruppercut@lemmy.zip
        link
        fedilink
        arrow-up
        7
        ·
        2 days ago

        It’s effective but it’s not right. The answer is 2 (or more) spaces before the line break. A comment recommending 3 or 13 or 1000 spaces before the break will get the job done but it’s not the “actual answer”.

  • Lena@gregtech.eu
    link
    fedilink
    English
    arrow-up
    20
    ·
    3 days ago

    You can put a backslash before the newline, like this

    line1\
    line2\
    line3
    

    gets formatted as:

    line1
    line2
    line3

  • Fondots@lemmy.world
    link
    fedilink
    arrow-up
    11
    ·
    3 days ago

    Two spaces at the end of the line
    Will give you what you’re looking for

    • Markdown also supports
    • Using asterisks followed by a space at the beginning of the line
    • To create bullet points like this
    1. Or numbered lists
    2. Like this one
    3. Which is pretty much just what-you-see-is-what-you-get
  • Chainweasel@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    3 days ago

    Two spaces after the last character.
    Like
    This
    On my phone I have to wait about a second between each space I enter because Android wants to automatically add a “.” to the end of a sentence if I double space too fast.

    • JRaccoon@discuss.tchncs.de
      link
      fedilink
      arrow-up
      2
      ·
      2 days ago

      Android wants to automatically add a “.” to the end of a sentence if I double space too fast

      If using GBoard, that can be disabled in settings. I don’t know anyone who actually uses that feature, I don’t know why it’s enabled by default.