Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 587
snapfractalpop Avatar asked May 13 '13 15:05

snapfractalpop


People also ask

How do I create a section in Markdown?

Headings. To create a heading, add number signs ( # ) in front of a word or phrase. The number of number signs you use should correspond to the heading level. For example, to create a heading level three ( <h3> ), use three number signs (e.g., ### My Header ).

How do you write plain text in Markdown?

Here are the basics: Italics: Add one asterisk or underscore around your text *like this* or _this_ Bold: Add two asterisks or underscores around your text **like this** or __this__ Bold and Italic: Add three asterisks or underscores around your text ***like this*** or ___this___

How do I highlight text in GitHub?

You can also create a Markdown hyperlink by highlighting the text and using the keyboard shortcut Command + V .

How do you mark a snippet in Markdown?

The basic Markdown syntax allows you to create code blocks by indenting lines by four spaces or one tab. If you find that inconvenient, try using fenced code blocks. Depending on your Markdown processor or editor, you'll use three backticks ( ``` ) or three tildes ( ~~~ ) on the lines before and after the code block.


3 Answers

Wrap the block in backticks:

```text
code();
[email protected]
```
like image 106
Matt Sweeney Avatar answered Oct 08 '22 08:10

Matt Sweeney


You can wrap such text in pre tags.

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

I just tested this out on github.

like image 29
Shawn Balestracci Avatar answered Oct 08 '22 09:10

Shawn Balestracci


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]
~~~
like image 42
prosti Avatar answered Oct 08 '22 09:10

prosti