Aran Mulholland Aran Mulholland - 4 years ago 232
Markdown Question

What is the correct address for an image in a markdown document in VSTS?

I have a README.md file in the root of my git repository hosted in Visual Studio Team Services.

When I navigate to the file in the web browser through the project portal I can see the correctly rendered markdown except for the images. I would like to add some screenshots to the README file and would like to know the correct way to reference an image stored stored in a folder at the

root of the repository/doc/images/image01.png


As the README file is also stored at the root of the repository I thought it would just be a relative link. When using Visual Studio Code on my computer (OSX) I can use relative paths and the images render correctly using the image tag as so:

![Alt text](doc/images/readmeFileComparison.png?raw=true "Readme file side by side comparison")


Does the image tag have to be different in order for me to view images when viewing the README file with the browser at (example url):

https://myaccount.visualstudio.com/ProjectName/_git/repositoryName?path=%2FREADME.md&version=GBmaster&_a=contents

There is guidance from Microsoft but there must be something I am missing. When the markdown is rendered I get a missing image tag. If I open the image in a new tab I get a HTTP 500 Error and the following message:


More information about this error

The item doc/images/pullNewChangesFromMaster.png?raw=true does not
exist at the specified version, or you do not have permission to
access it.


I get the same error even if the addresses have or are missing a leading forward slash from the address.

![Alt text](doc/images/pullNewChangesFromMaster.png?raw=true "About to Pull down the new changes")


or

![Alt text](/doc/images/pullNewChangesFromMaster.png?raw=true "About to Pull down the new changes")

Answer Source

Reading the Guidance page from Microsoft, I do not see ?raw=true mentioned anywhere.

So it is best to try your relative link without it.

![Alt text](doc/images/pullNewChangesFromMaster.png "About to Pull down the new changes")
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download