Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to escape backslash bracket (\[) in Markdown?

How does one escape the "backslash square brackets" \[ \] sequence in Markdown for GitHub? The sequence produces a <pre><code>...</code></pre> section.

This is only a problem with Markdown for GitHub. I can write it here without the problem:

\[something \]

This code in GitHub will however produce

\ something

like image 239
Bernard Avatar asked Apr 16 '13 02:04

Bernard


People also ask

How do you escape angle brackets in Markdown?

Automatic Escaping for Special Characters Left angle brackets are used to start tags; ampersands are used to denote HTML entities. If you want to use them as literal characters, you must escape them as entities, e.g. &lt; , and &amp; . in your anchor tag href attribute.

How do you display curly braces in Markdown?

Is there some other way to display curly brackets in markdown? Similarly if you ever just need a left or right curly brace use {{ or }} . Stu - you are a star! That did the trick, and thanks for your speedy reply.


2 Answers

This has been fixed on github.com. I'm not sure when, but you can now escape square brackets with a single backlash. EG

\[Hello\] 

is rendered as

[Hello]

like image 107
kev_walsh Avatar answered Sep 19 '22 09:09

kev_walsh


I have resorted to surrounding my bracketed string with backticks: `[[320,50],[300,250]]`

Which turns it into: [[320,50],[300,250]] So now my array doesn't turn into a link.

like image 25
frandroid Avatar answered Sep 18 '22 09:09

frandroid