Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent destruction of linebreaks in gist.github.com?

Tags:

github

gist

EDIT: Youtube video demonstrating the issue:

https://www.youtube.com/watch?v=0D0rNfUhiKQ

EDIT: Pasting is critical here. When I paste 10 lines copied from a text editor, gist.github.com spews it into 1 line.

I'm pasting this into gist.github.com

return (
  <div className="App">
    <h1>Quantum Pilot</h1>
      <div className="content">
        <div className="box"><About/></div>
        <div className="box">HnnYoutube</div>
        <div className="box">{buy}</div>
        <div className="box">{mykeys}</div>
      </div>
      <MetamaskPrompt enabled={this.state.metamask}/>
  </div>
);

10 lines but - gist.github.com turns into 1 line, poorly spaced. If I click "soft wrap", it takes up 2 lines.

Why are my newlines being destroyed?

like image 615
quantumpotato Avatar asked Jan 17 '18 19:01

quantumpotato


1 Answers

Make sure you are using the backtick in your gist, in order to preserve the format:

````
your code
your code
...
your code
````

That way, you will preserve those lines as they are formatted initially.

Note: your gist should be named with an .md extension (markdown).

See mine: testwrap.md:

test wrap

like image 61
VonC Avatar answered Nov 09 '22 11:11

VonC