diff --git a/.vscode/settings.json b/.vscode/settings.json index 7ebedd4..c3d1b27 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -10,5 +10,5 @@ "typescript.tsc.autoDetect": "off", "editor.detectIndentation": false, "prettier.tabWidth": 2, - "prettier.singleQuote": true + "prettier.singleQuote": true } diff --git a/package-lock.json b/package-lock.json index d789feb..0e19909 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "gitea-vscode", - "version": "2.0.0", + "version": "2.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "gitea-vscode", - "version": "2.0.0", + "version": "2.1.0", "license": "MIT", "dependencies": { "axios": "^0.27.2", diff --git a/src/template.issues.ts b/src/template.issues.ts index 16aafdd..dce021d 100644 --- a/src/template.issues.ts +++ b/src/template.issues.ts @@ -1,4 +1,4 @@ -import { Issue } from './issue'; +import { Issue } from "./issue"; export function showIssueHTML(issue: Issue) { return ` @@ -34,22 +34,26 @@ export function showIssueHTML(issue: Issue) {

` - .replace('{{label}}', issue.label) - .replace('{{state}}', issue.state) - .replace('{{assignee}}', issue.assignee) - .replace('{{description}}', issue.body) - .replace('{{label}}', issue.label); + .replace("{{label}}", issue.label) + .replace("{{state}}", issue.state) + .replace("{{assignee}}", issue.assignee) + .replace("{{description}}", issue.body) + .replace("{{label}}", issue.label); } - export function showIssueMD(issue: Issue) { - let md_labels = issue.labels.map(label => { - return '![' + label.name + '](https://img.shields.io/badge/' + label.name + '-' + label.color + '.svg)' - }).join(', ') + let md_labels = issue.labels.map((label) => { + return "![" + label.name + "](https://img.shields.io/badge/" + + label.name.replaceAll(" ", "%20") + "-" + label.color + ".svg)"; + }).join(" "); - let assignees = issue.assignees === null ? "Nobody" : issue.assignees.map(assignee => { return assignee.login }).join(', '); + let assignees = issue.assignees === null + ? "Nobody" + : issue.assignees.map((assignee) => { + return assignee.login; + }).join(", "); - let md = `# {{title}} (#{{id}}) + let md = `# {{title}} (#{{id}}) {{description}} @@ -60,13 +64,13 @@ export function showIssueMD(issue: Issue) { * Labels: {{labels}} * [See in browser]({{html_url}}) ` - .replace('{{title}}', issue.title) - .replace('{{id}}', issue.issueId.toString()) - .replace('{{description}}', issue.body) - .replace('{{state}}', issue.state) - .replace('{{assignee}}', assignees) - .replace('{{labels}}', md_labels) - .replace('{{html_url}}', issue.html_url) + .replace("{{title}}", issue.title) + .replace("{{id}}", issue.issueId.toString()) + .replace("{{description}}", issue.body) + .replace("{{state}}", issue.state) + .replace("{{assignee}}", assignees) + .replace("{{labels}}", md_labels) + .replace("{{html_url}}", issue.html_url); - return md + return md; } diff --git a/tsconfig.json b/tsconfig.json index b65c745..4bb13f9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,7 @@ "target": "es6", "outDir": "out", "lib": [ - "es6" + "es2021" ], "sourceMap": true, "rootDir": "src",