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:
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?
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.
Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!
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.