frontend: build relative submodule links in a safer way
Created by: flying-robot
Refactoring suggested by @keegancsmith.
ref https://github.com/sourcegraph/sourcegraph/pull/15441/files#r519639497
Created by: flying-robot
Refactoring suggested by @keegancsmith.
ref https://github.com/sourcegraph/sourcegraph/pull/15441/files#r519639497