snapfractalpop
snapfractalpop

Reputation: 2134

How do you display a section of plain text in GitHub markdown?

I'm having a hard time finding any real answer to this (really simple?) question on Google, and I'm starting to worry that there is no solution.

I am learning GitHub markdown. I would like to show some example code that contains fake email address like [email protected]. But GitHub insists on auto-linking this text. I also have a large chunk of text that has many special characters.

Is there a way to escape blocks or sections so that no special characters are processed, and no auto-links are generated?

Upvotes: 50

Views: 68429

Answers (3)

prosti
prosti

Reputation: 46301

This is all part of the kramdown syntax. The last link shows every GitHub markdown trick.

So this will work also:

~~~text
code();
[email protected]
~~~

Upvotes: 9

Shawn Balestracci
Shawn Balestracci

Reputation: 7530

You can wrap such text in pre tags.

<pre>Text I want left [email protected]</pre>

I just tested this out on github.

Upvotes: 33

Matt Sweeney
Matt Sweeney

Reputation: 2130

Wrap the block in backticks:

```text
code();
[email protected]
```

Upvotes: 101

Related Questions