From 553a0b05d38d1cbcb64980382148e8d0e187d0bd Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Fri, 9 Sep 2016 17:55:40 -0400 Subject: [PATCH] Linkify issue/pr references in issue titles --- .js/github.com.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.js/github.com.js b/.js/github.com.js index 403ed28..94cead7 100644 --- a/.js/github.com.js +++ b/.js/github.com.js @@ -1,10 +1,12 @@ +// utils +let repoUrl = $("div.repohead-details-container > h1.public > strong[itemprop=name] > a").attr("href"); + // don't use the (ugly) new font // $("body").css("font-family", $("body").css("font-family").replace("BlinkMacSystemFont,", "")); // releases tab let repoNav = $("nav.reponav"); if (repoNav.length > 0) { - let repoUrl = $("div.repohead-details-container > h1.public > strong[itemprop=name] > a").attr("href"); let releasesUrl = repoUrl + "/releases"; let releasesTab = $(""); releasesTab.attr("href", releasesUrl); @@ -64,4 +66,12 @@ $("span.commit-ref").each((i, el) => { link.attr("href", `https://github.com/${repo}/tree/${branch}`); el.wrap(link); }); -$("body").after(""); \ No newline at end of file +$("body").after(""); + +// linkify issue/pr references in issue titles +(function() { + let title = $("span.js-issue-title"); + if (/#(\d+)/.test(title.text())) { + title.html(title.text().replace(/#(\d+)/, `#$1`)); + } +})(); \ No newline at end of file