Skip to content

Commit c30725a

Browse files
committed
Fixes #33 (again) - commit messages rendered as markdown in hovers
Fixes line-breaks on hover commit messages
1 parent 717e24b commit c30725a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
2929
### Fixed
3030

3131
- 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))
32+
- Fixes [#33](https://github.com/eamodio/vscode-gitlens/issues/33) — Commit messages can causes markdown formatting in hovers
3233
- Fixes [#501](https://github.com/eamodio/vscode-gitlens/issues/501) — Azure DevOps ssh remotes aren't handled properly
3334
- Fixes [#523](https://github.com/eamodio/vscode-gitlens/issues/523) — File History doesn't show all commits on file
3435
- Fixes [#552](https://github.com/eamodio/vscode-gitlens/issues/552) — "Open Line Changes with..." doesn't work for renamed files

src/annotations/annotations.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,13 @@ export class Annotations {
151151
break;
152152
}
153153

154-
message
154+
message = `\n\n> ${message
155155
// Escape markdown
156156
.replace(escapeMarkdownRegex, '\\$&')
157157
// Escape markdown header (since the above regex won't match it)
158158
.replace(/^===/gm, markdownHeaderReplacement)
159-
// Keep under the same block-quote
160-
.replace(/\n/g, ' \n');
161-
message = `\n\n> ${message}`;
159+
// Keep under the same block-quote but with line breaks
160+
.replace(/\n/g, '\t\n> ')}`;
162161
}
163162
else {
164163
showCommitDetailsCommand = `\`${commit.shortSha === 'Working Tree' ? '00000000' : commit.shortSha}\``;

0 commit comments

Comments
 (0)