vscode
Public

Visual Studio Code

Images from private repositories not loaded in markdown preview#247854

Open
Opened 4/30/20251 commentsby victorwads
victorwads

<!-- ⚠️⚠️ Do Not Delete This! feature_request_template ⚠️⚠️ --> <!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ --> <!-- Please search existing issues to avoid creating duplicates. --> <!-- Describe the feature you'd like. --> ## Description: When you use an GitHub image reference into a Markdown file like: `https://github.com/user-attachments/assets/39942c49-500f-4f26-b6c2-a08fbddbbb0b` it’s uploaded as a private-repo asset and renders perfectly in GitHub’s preview. But in VS Code, those images break because the preview pane doesn’t authenticate to fetch private assets. ## Steps to Reproduce: On GitHub.com, open or create a Markdown (.md) file in a private repository. 1. Paste an image via Ctrl+V—GitHub uploads it and inserts a link like: ```md ![image](https://github.com/user-attachments/assets/39942c49-500f-4f26-b6c2-a08fbddbbb0b) ``` 1. Commit your changes. 1. In GitHub.com’s own preview, the image displays correctly. 1. Clone/open the repo in VS Code (or open it on github.dev) and launch the built-in Markdown preview. 1. Observe: the image link returns 404/unauthorized and fails to load. ## Expected Behavior: VS Code should reuse your GitHub credentials (session or PAT) in the Markdown preview so that private-repo assets load seamlessly. ## Actual Behavior: Preview fetches asset URLs without auth headers, resulting in broken images. ## Proposed Solutions: - Authenticate the preview pane using your GitHub session or a user-provided token. - Cache pasted assets locally and fallback to the local file if remote fetch fails. - Add a setting for supplying a Personal Access Token for private-repo asset access.

AI Analysis

This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be still under discussion. The issue was opened by victorwads and has received 1 comments.

Add a comment
Comment form would go here