Embedding a code snippet broken?

Some time ago there was an announcement for the embedded code snippets and a help page that reiterates on the same topic and the feature worked for me in the past. But in last few weeks I had noticed that whenever I paste the lines permalink I end up just with a link text in the issue or comment verbatim, no code snippet inserted.

Did anything change regarding inserting code snippets with permalinks? Did it break for me only?

Example of the permalink I tried to insert:


What’s wrong?


Hi @agr,

When I use the permalink that you supplied, the embedded code seems to work for me:

If this is not what you’re seeing, I would recommend that you contact GitHub Support so they can directly troublehsoot your issue.


1 Like

Thanks. Yes, I that’s what I expect to see, but not what I am seeing. In my case link just stays as is. Will try contacting support.

Example isssue: https://github.com/agr/snippetpastetest/issues/1

I experience the same. I also only see a link instead of a code snippet when copy-pasting the link you provided.

Did you ever find out why it didn’t work for you?

Hi @agr and @bartlangelaan,

Where are you trying to insert the link? Are you putting it into a comment in the same repository?


Is it not possible to embed a code snippet that references a different repository than the one you’re commenting on?


Hi @kylebarron,

That is correct. Currently, this only works if you’re referencing a code snippet in the repository it lives in. From the Help documentation: “This type of permanent link will render as a code snippet only in the repository it originated in. In other repositories, the permalink code snippet will render as a URL.”

That said, I can definitely see the value in having this work across repositories. I’ll share this request internally. Though I can’t guarantee anything or share a timeline for this, I can tell you that it’s been shared with the appropriate teams for consideration.



I would also prefer for it to display a preview to other repositories. I also got confused and thought it was broken until I found this thread.


Seems like this is still broken


I still have this problem and referenced code snippet belongs to the same repository. Here is a reproduced case:


1 Like

I’m also seeing this issue.

Reproduced example:


Doesn’t work for me either. Reproduced it in a sandbox repo.

I have the exact same problem in a private repo.

I got the same exact issue ! snippets don’t work!

Thanks everyone for writing in about this. We’re sorry for the trouble. This is due to an issue on our side that our team is aware of and working on. I don’t have an ETA on a fix right now but this is in good hands.

Thanks again for letting us know!

1 Like

This had been fixed for a while, but it’s now broken again. I thought I’d notify you in case you didn’t know already.

FWIW, same issue here.

Example: https://github.com/docsifyjs/docsify/issues/528

1 Like

me too!

(just writing random things to pass the 20 character limit)

Seems to be fixed. I personally made the mistake of embedding the URL as a link. You just need to paste it in and that’s it.

Seems still broken.