@nanocollective/roster 0.1.0-alpha.31 → 0.1.0-alpha.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -361,7 +361,9 @@ function mdAsset(src, opts) {
|
|
|
361
361
|
return path ? "/api/file?path=" + encodeURIComponent(opts.file.staffDir + "/" + path) : src;
|
|
362
362
|
}
|
|
363
363
|
|
|
364
|
-
|
|
364
|
+
/* #123, repo#123 and owner/repo#123. The short repo form is how the staff write about the other
|
|
365
|
+
repos in their own org (pip-web#172), and it was left as plain text. */
|
|
366
|
+
const REF_RE = /(^|[\s(>])((?:[\w.-]+\/)?[\w.-]+)?#(\d+)\b/g;
|
|
365
367
|
// GitHub's own username shape, plus the short aliases the agents answer to.
|
|
366
368
|
const AT_RE = /(^|[\s(>])@([a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})\b/gi;
|
|
367
369
|
|
|
@@ -381,7 +383,8 @@ export function chips(html, opts = {}) {
|
|
|
381
383
|
if (inA) return p;
|
|
382
384
|
return p
|
|
383
385
|
.replace(REF_RE, (m, pre, repo, n) => {
|
|
384
|
-
const
|
|
386
|
+
const owner = String(opts.repo ?? "").split("/")[0];
|
|
387
|
+
const target = !repo ? opts.repo : repo.includes("/") ? repo : owner ? owner + "/" + repo : "";
|
|
385
388
|
if (!target) return m;
|
|
386
389
|
// /issues/N redirects to /pull/N when it is a PR, so one form is always right.
|
|
387
390
|
return pre + '<a class="ref" href="https://github.com/' + target + "/issues/" + n +
|