Skip to content

Commit

Permalink
Fixes #33 (again) - commit messages rendered as markdown in hovers
Browse files Browse the repository at this point in the history
Fixes line-breaks on hover commit messages
  • Loading branch information
eamodio committed Dec 12, 2018
1 parent 717e24b commit c30725a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions src/annotations/annotations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}\``;
Expand Down

0 comments on commit c30725a

Please sign in to comment.