1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +02:00

Tools: Linkify GitHub links

This commit is contained in:
Laurent Cozic
2023-09-13 20:34:16 +01:00
parent 74ae9740b6
commit 15edd351a1
2 changed files with 8 additions and 2 deletions

View File

@@ -422,6 +422,12 @@ export async function githubRelease(project: string, tagName: string, options: a
return responseJson;
}
export const gitHubLinkify = (markdown: string) => {
markdown = markdown.replace(/#(\d+)/g, '[#$1](https://github.com/laurent22/joplin/issues/$1)');
markdown = markdown.replace(/\(([a-f0-9]+)\)/g, '([$1](https://github.com/laurent22/joplin/commit/$1))');
return markdown;
};
export function readline(question: string) {
return new Promise((resolve) => {
const readline = require('readline');