github-flavored-markdown icon indicating copy to clipboard operation
github-flavored-markdown copied to clipboard

Cannot escape a hash immediately before a number

Open AJNeufeld opened this issue 9 years ago • 6 comments

Escaping the hash (#) does not work, when followed by digits.

I'd like to write about a transformer winding, specifically, winding number 1 or winding number 2. Of course, writing ... transformer winding #1 is ... results in #1 being treated as an issue link to Issue #1, which (on this site) is "Github Flavored Markdown Examples", totally unrelated to power transformers. :wink:

However, escaping the hash does not seem to be possible: \#1 still results in #1, the issue link.

Using HTML entities for the # or digits does not fool the Markdown parser into not seeing character sequence as an issue link:

  • #1 results in the link #1
  • #1 also results in #1

AJNeufeld avatar Jul 19 '16 15:07 AJNeufeld

A hacky workaround is to insert a zero width character between the hash and the number e.g. gulpjs\/gulp#​4.0 → gulpjs/gulp#​4.0.

Of course, if someone copies 'n' pastes this, they will wind up with an unexpected zero-width space in their text...

chocolateboy avatar Jan 24 '17 21:01 chocolateboy

I know this is pretty old and perhaps not a top priority, but was there any update?

jefersonchaves avatar Jun 25 '23 12:06 jefersonchaves

On our private gitlab server, Transformer \#1 no longer links to issue #1, so it seems to be fixed in some code bases and is no longer an issue for us personally, 👍

... but still seems to be an issue here on GitHub! 😆

AJNeufeld avatar Jun 27 '23 18:06 AJNeufeld