(html: string)
| 5 | import {shortenLink} from '../source/github-helpers/dom-formatters.js'; |
| 6 | |
| 7 | function 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 | |
| 18 | const originalPathname = location.pathname; |
| 19 |
no test coverage detected