Relative URLs in markdown documents are incorrect
Created by: manicminer
Summary
I have a project with a README.md, which contains a relative link to the tree view of the project, in the form /group/project/tree/master
. Since updating from 7.7.2 to 7.8.0, the link is rendered incorrectly as /group/project/blob/master/group/project/tree/master
.
To reproduce
Create a project with README.md
containing:
[Click here](/group/project/tree/master) to browse the project
Expected result
Clicking the link should take me to http://gitlab.hostname/group/project/tree/master. This was the case with Gitlab 7.7.2
Actual result
Clicking the link takes me to http://gitlab.hostname/group/project/blob/master/group/project/tree/master
GitLab version
GitLab 7.8.0 bcc8dbd
Installed with gitlab_7.8.0-omnibus-1_amd64.deb
Output of rake gitlab:check
Checking Environment ...
Git configured for git user? ... yes
Checking Environment ... Finished
Checking GitLab Shell ...
GitLab Shell version >= 2.5.3 ? ... OK (2.5.3)
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
Satellites access is drwxr-x---? ... yes
hooks directories in repos are links: ...
2/1 ... ok
4/2 ... ok
2/4 ... ok
2/5 ... ok
2/6 ... ok
2/7 ... ok
5/8 ... ok
6/9 ... ok
2/10 ... ok
2/11 ... ok
2/12 ... ok
5/13 ... ok
2/14 ... ok
3/15 ... ok
3/16 ... ok
3/17 ... ok
2/18 ... ok
3/19 ... ok
2/39 ... ok
5/40 ... ok
2/41 ... ok
2/43 ... ok
2/44 ... ok
2/45 ... ok
2/47 ... ok
3/48 ... repository is empty
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Check directories and files:
/var/opt/gitlab/git-data/repositories: OK
/var/opt/gitlab/.ssh/authorized_keys: OK
Test redis-cli executable: redis-cli 2.8.2
Send ping to redis server: PONG
gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... skipped (omnibus-gitlab has no init script)
Init script up-to-date? ... skipped (omnibus-gitlab has no init script)
projects have namespace: ...
2/1 ... yes
4/2 ... yes
2/4 ... yes
2/5 ... yes
2/6 ... yes
2/7 ... yes
5/8 ... yes
6/9 ... yes
2/10 ... yes
2/11 ... yes
2/12 ... yes
5/13 ... yes
2/14 ... yes
3/15 ... yes
3/16 ... yes
3/17 ... yes
2/18 ... yes
3/19 ... yes
2/39 ... yes
5/40 ... yes
2/41 ... yes
2/43 ... yes
2/44 ... yes
2/45 ... yes
2/47 ... yes
3/48 ... yes
Projects have satellites? ...
2/1 ... yes
4/2 ... yes
2/4 ... yes
2/5 ... yes
2/6 ... yes
2/7 ... yes
5/8 ... yes
6/9 ... yes
2/10 ... yes
2/11 ... yes
2/12 ... yes
5/13 ... yes
2/14 ... yes
3/15 ... yes
3/16 ... yes
3/17 ... yes
2/18 ... yes
3/19 ... yes
2/39 ... yes
5/40 ... yes
2/41 ... yes
2/43 ... yes
2/44 ... yes
2/45 ... yes
2/47 ... yes
3/48 ... yes
Redis version >= 2.0.0? ... yes
Ruby version >= 2.0.0 ? ... yes (2.1.5)
Your git bin path is "/opt/gitlab/embedded/bin/git"
Git version >= 1.7.10 ? ... yes (2.0.5)
Checking GitLab ... Finished