MCPcopy Index your code
hub / github.com/refined-github/refined-github / shortenLinksInFragment

Function shortenLinksInFragment

test/shorten-link.test.ts:7–16  ·  view source on GitHub ↗
(html: string)

Source from the content-addressed store, hash-verified

5import {shortenLink} from '../source/github-helpers/dom-formatters.js';
6
7function shortenLinksInFragment(html: string): string {
8 const {document} = parseHTML(html);
9
10 const links = $$optional('a', document);
11 for (const link of links) {
12 shortenLink(link);
13 }
14
15 return document.documentElement.outerHTML;
16}
17
18const originalPathname = location.pathname;
19

Callers 1

Calls 1

shortenLinkFunction · 0.85

Tested by

no test coverage detected