From 3d95a93054329df5a1eb395654c7171dffb25ea8 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Fri, 19 Apr 2019 15:56:01 -0400 Subject: [PATCH] Removes line breaks from ${message} itself --- package.json | 2 +- src/git/formatters/commitFormatter.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 971bc2e..d122719 100644 --- a/package.json +++ b/package.json @@ -565,7 +565,7 @@ }, "gitlens.hovers.detailsMarkdownFormat": { "type": "string", - "default": "[${avatar}  __${author}__](mailto:${email}), ${ago}   _(${date})_ ${message}\n\n${commands}", + "default": "[${avatar}  __${author}__](mailto:${email}), ${ago}   _(${date})_ \n\n${message}\n\n${commands}", "markdownDescription": "Specifies the format (in markdown) of the _commit details_ hover. See the [GitLens docs](https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting) for advanced formatting\n- Available tokens\n - `${id}` — commit id\n - `${author}` — commit author\n - `${email}` — commit author e-mail\n - `${message}` — commit message\n - `${ago}` — relative commit date (e.g. 1 day ago)\n - `${date}` — formatted commit date (format specified by `#gitlens.defaultDateFormat#`)\n - `${agoOrDate}` — commit date specified by `#gitlens.defaultDateStyle#`\n - `${authorAgo}` — commit author, relative commit date\n - `${authorAgoOrDate}` — commit author, commit date specified by `#gitlens.defaultDateStyle#`\n - `${avatar}` — commit author avatar\n - `${commands}` — a set of commit commands", "scope": "window" }, diff --git a/src/git/formatters/commitFormatter.ts b/src/git/formatters/commitFormatter.ts index f270582..c9d0bd3 100644 --- a/src/git/formatters/commitFormatter.ts +++ b/src/git/formatters/commitFormatter.ts @@ -213,7 +213,7 @@ export class CommitFormatter extends Formatter { } } - return `\n\n> ${message + return `\n> ${message // Escape markdown .replace(escapeMarkdownRegex, '\\$&') // Escape markdown header (since the above regex won't match it)