Code Snippets not working anymore #54598
Replies: 7 comments 6 replies
-
|
is there any issue to track this? |
Beta Was this translation helpful? Give feedback.
-
|
Same here. It doesn't work in either the issue body or the following comments, no matter the code snippet is public or private. |
Beta Was this translation helpful? Give feedback.
-
|
Yes, it's a shame it doesn't work anymore, it was a nice feature ! |
Beta Was this translation helpful? Give feedback.
-
|
For personal repo, code snippets/ permalinks work when referring to codes within same repo, not when referring to codes within other repos. |
Beta Was this translation helpful? Give feedback.
-
|
I ran into as well and noticed that it seems to be because of using URLs pointing to the HEAD of a branch instead of a permalink. When using VSCode and selecting 'Open file on remote', it brings you to GitHub in the browser and displays the file and highlights the line. When on GitHub viewing the line/file, a permalink needs to be created to allow gitHub to expand it. This makes sense as the HEAD of a branch may change over time. This will work: https://github.com/DependencyTrack/dependency-track/blob/bcd26514f100f53554a3e35b003ecf9a6c0bdc26/src/test/java/org/dependencytrack/tasks/repositories/NugetMetaAnalyzerTest.java#L164 |
Beta Was this translation helpful? Give feedback.
-
|
Status update for Apr - Will work for single line permalinks. not for Multiline ones. Pretty obvious how to fix it. But currently you have to paste the link into a script to fix it. Edit - This is outdated now, why? Test for yourself when a multiline one stops working. Pick any public repo. Edit - It's not reproducible in the exact same conditions. This means something changed and there is an unknown condition involved. Which explains why this hasn't been fixed, it can't be fixed by traditional methods anymore(you can also hypothesize). Manish Details
Check out my kind of oldfangled, kinda newfangled, kinda cool, inevitably thought-provoking profile. And the limited mentorship opportunities for your no matter the non business major you have chosen be it - Bachelor's or Master's or Doctorates or Post-Doctorates. |
Beta Was this translation helpful? Give feedback.
-
|
It seems that for repos where the link was added months ago, it works. But for new links, it does not work. Does the link requires to be permanent? Or can it reference the master branch also? I'm asking because despite the age, that's the second difference between the two cases mentioned above. |
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Bug
Select Feature Area
Body
https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-a-permanent-link-to-a-code-snippet
when pasting permalink in issues, they doesn't seem to convert into code blocks anymore?
for example: microsoft/vscode#181676
Guidelines
Beta Was this translation helpful? Give feedback.
All reactions