github/markup — Issue #101: Branch relative links in markdown files
Author: davekinkead
Created: 2012-01-30 01:48:14+00:00
State: open

A really annoying issue on github is the parsing of links in readme files. Not just for me but for lots of people (see https://github.com/github/markup/issues/84 http://stackoverflow.com/questions/7653483/github-relative-link-in-markdown-file)

For readme links to currently work, the absolute link including repo/blob/branch must be hardcoded. That works when viewing on git hub but not for local files. Alternatively, relative links work on local but not on github.

So, why can't github just add the 'repo/blob/branch' part to any relative urls in .md files when parsing? That way, when we want to point an absolute, we include the http://....., and when we want to link to other project files, it works both locally & on github. The whole git philosophy is about distributed control but the current link parsing goes against this

Example

> [some text][link]
> [link]:subdir/filename

when in a markdown file should be parsed to http://github.com/account/project/blob/branch/subdir/filename