From c30725a494ada140f4bc079273f75f533e4323d6 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Wed, 12 Dec 2018 02:50:49 -0500 Subject: [PATCH] Fixes #33 (again) - commit messages rendered as markdown in hovers Fixes line-breaks on hover commit messages --- CHANGELOG.md | 1 + src/annotations/annotations.ts | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4487b62..b06f34d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p ### Fixed - Fixes an issue where gravatar icons would sometimes not show up — thanks to [PR #579](https://github.com/eamodio/vscode-gitlens/pull/579) by sgtwilko ([@sgtwilko](https://github.com/sgtwilko)) +- Fixes [#33](https://github.com/eamodio/vscode-gitlens/issues/33) — Commit messages can causes markdown formatting in hovers - Fixes [#501](https://github.com/eamodio/vscode-gitlens/issues/501) — Azure DevOps ssh remotes aren't handled properly - Fixes [#523](https://github.com/eamodio/vscode-gitlens/issues/523) — File History doesn't show all commits on file - Fixes [#552](https://github.com/eamodio/vscode-gitlens/issues/552) — "Open Line Changes with..." doesn't work for renamed files diff --git a/src/annotations/annotations.ts b/src/annotations/annotations.ts index e9ea3f4..12a8e89 100644 --- a/src/annotations/annotations.ts +++ b/src/annotations/annotations.ts @@ -151,14 +151,13 @@ export class Annotations { break; } - message + message = `\n\n> ${message // Escape markdown .replace(escapeMarkdownRegex, '\\$&') // Escape markdown header (since the above regex won't match it) .replace(/^===/gm, markdownHeaderReplacement) - // Keep under the same block-quote - .replace(/\n/g, ' \n'); - message = `\n\n> ${message}`; + // Keep under the same block-quote but with line breaks + .replace(/\n/g, '\t\n> ')}`; } else { showCommitDetailsCommand = `\`${commit.shortSha === 'Working Tree' ? '00000000' : commit.shortSha}\``;