Skip to content

Commit f7eda70

Browse files
Improvement url's parser
1 parent 996c1b1 commit f7eda70

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/node/plugins/url.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
export const url = (value: string, link?: string) => {
2-
return `<a href="https://github.com/${ (link || value).replace('github.com', '') }" target="_blank" rel="noopener noreferrer">${ value } <ExternalLinkIcon /></a>`
2+
link = (link || value).replace('https://github.com/', '')
3+
4+
return `<a href="https://github.com/${ link }" target="_blank" rel="noopener noreferrer">${ value } <ExternalLinkIcon /></a>`
35
}

0 commit comments

Comments
 (0)