Fix linkifying branch references
This commit is contained in:
parent
d4e0d31a90
commit
b970f0431d
|
@ -64,12 +64,15 @@ let repoUrl = $("div.repohead-details-container > h1.public > strong[itemprop=na
|
||||||
(function() {
|
(function() {
|
||||||
$("span.commit-ref").each((i, el) => {
|
$("span.commit-ref").each((i, el) => {
|
||||||
el = $(el);
|
el = $(el);
|
||||||
let bits = el.attr("title").split(":");
|
let title = el.attr("title");
|
||||||
let repo = bits[0];
|
if (title) {
|
||||||
let branch = bits[1];
|
let bits = title.split(":");
|
||||||
let link = $("<a></a>");
|
let repo = bits[0];
|
||||||
link.attr("href", `https://github.com/${repo}/tree/${branch}`);
|
let branch = bits[1];
|
||||||
el.wrap(link);
|
let link = $("<a></a>");
|
||||||
|
link.attr("href", `https://github.com/${repo}/tree/${branch}`);
|
||||||
|
el.wrap(link);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
$("body").after("<style>span.commit-ref:hover, span.commit-ref:hover span { text-decoration: underline; }</style>");
|
$("body").after("<style>span.commit-ref:hover, span.commit-ref:hover span { text-decoration: underline; }</style>");
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Reference in New Issue