Ver código fonte

Fixes #33 (again) - commit messages rendered as markdown in hovers

Fixes line-breaks on hover commit messages
main
Eric Amodio 6 anos atrás
pai
commit
c30725a494
2 arquivos alterados com 4 adições e 4 exclusões
  1. +1
    -0
      CHANGELOG.md
  2. +3
    -4
      src/annotations/annotations.ts

+ 1
- 0
CHANGELOG.md Ver arquivo

@ -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

+ 3
- 4
src/annotations/annotations.ts Ver arquivo

@ -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}\``;

Carregando…
Cancelar
Salvar