How to use the shorten-repo-url.applyToLink function in shorten-repo-url

To help you get started, we’ve selected a few shorten-repo-url examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sindresorhus / refined-github / source / features / shorten-links.tsx View on Github external
function init(): void {
	for (const a of select.all(`a[href]:not(.${linkifiedURLClass})`)) {
		applyToLink(a, location.href);
	}
}
github sindresorhus / refined-github / source / options.tsx View on Github external
function parseDescription(description: string): DocumentFragment {
	const descriptionElement = <span>{description}</span>;
	domFormatters.linkifyIssues(descriptionElement, {
		baseUrl: 'https://github.com',
		user: 'sindresorhus',
		repository: 'refined-github'
	});
	domFormatters.linkifyURLs(descriptionElement);
	domFormatters.parseBackticks(descriptionElement);

	for (const a of select.all('a', descriptionElement)) {
		applyToLink(a);
	}

	return descriptionElement;
}

shorten-repo-url

Shorten GitHub URLs like GitHub shortens Issues and Commit URLs

MIT
Latest version published 1 month ago

Package Health Score

76 / 100
Full package analysis

Popular shorten-repo-url functions