Escape pound or number sign in Github issue tracker
GithubGithub PagesGithub Problem Overview
If I type #1
when creating an Issue in Github, it will reference to Issue ID 1
. Is there a way to avoid this by escaping the #
sign? I just need it to be regular text.
Github Solutions
Solution 1 - Github
short answer
choose from this list:
#⁠1
⯇ #
— <invisible character> — 1
<span>#</span>1
<i>#</i>1
⯇ the number sign will be italic
\# 1
#1
⯇ you need to copy-paste this!
#
— <invisible character> — 1
even works for commit messages.
more generic answer
These are the options you have:
- Option A: put any non-numeric (
[0-9]+
) UTF-8 character between#
and the number- using the character itself (e.g.
# 1
) — this will even work in commit messages - using an HTML entity (e.g.
# 1
) — useful for characters not on your keyboard
- using the character itself (e.g.
- Option B: use formatting on either
#
or the number- using Markdown (e.g.
#*1*
) - using HTML tag (e.g.
#<i>1</i>
) - NOTE that not all formatting variants, especially the Markdown ones, do always work!
- using Markdown (e.g.
long answer
1 use a space character
You can put any kind of space character between #
and the number.
U+2060
1.a word joiner — This is the most unobtrusive solution:
#⁠1
⇒ #1
In this case the space character is written as ⁠
, that's the numeric character reference for the WORD JOINER
unicode character [3].
The word joiner (WJ) is a zero width non-breaking space; that is, it's not visible (zero width) [4] and prevents #
and the number from being separated by an automatic line break (non-breaking) [5].
U+0020
/ no-break space — U+00A0
1.b regular space — Of course you can use a "normal" space, which is faster to type than ⁠
:
\# 1
⇒ # 1
The backslash before the hash sign (\#
) prevents the line from becoming a heading in case \# 1
is at the beginning of the line.
The \# 1
solution uses a breaking space. To use a non-breaking space, type instead: # 1
(no backslash needed).
1.c hint for advanced keyboard users
If you're using an ”advanced“ keyboard layout such as Colemak or Neo (german), you can use it to type special spaces — non-breaking spaces (NBSP) and narrow non-breaking spaces (NNBSP).
\# 1
⇒ # 1 (NBSP)\# 1
⇒ # 1 (NNBSP)
2 use formatting
Besides the solution of putting an extra character between #
and the number, you can use markdown or HTML formatting. Below I'm providing some examples. Some solutions are striked out because they do not work (anymore).
Please note that the functionality could change at any time in case GitHub changes its code.
- using
<span>
(as stated by Sam Harwell)<span>#</span>1
⇒ #1
- using italic font:
*#*1
⇒ #1<i>#</i>1
⇒ #1#*1*
⇒ #1#<i>1</i>
⇒ #1
- using strong font:
**#**1
⇒ #1<b>#</b>1
⇒ #1#**1**
⇒ #1#<b>1</b>
⇒ #1
- using single backticks:
`#1`
⇒#1
`#`1
⇒#
1#`1`
⇒ #1
Solution 2 - Github
You can use the following:
<span>#</span>1
I was quite surprised that the following did not work:
#1
Solution 3 - Github
Use this `#1` and it worked.
Basically I have to escape by turning it into code quote
Solution 4 - Github
Just tested these and they seem to work:
<nav>#1
<section>#1
<section>#</section>1
Solution 5 - Github
For me this #_1
seems to work in github markdown.