vscode-gitlens icon indicating copy to clipboard operation
vscode-gitlens copied to clipboard

Hover no longer correctly shows newlines

Open CodyJung opened this issue 2 years ago • 1 comments

GitLens version: v12.1.1 VSCode: 1.68.1 Windows 10 Git: 2.30.2

Recently (I'm guessing with the 12.1.0 update, since it's been within the last week or so), it seems like the hover text no longer shows all newlines correctly. It kind of feels like how Markdown condenses lines together?

Here's what I wrote originally in vim: image

Here's that same message in gitk: image

And here's how GitLens renders it in the hover: image

CodyJung avatar Jun 20 '22 19:06 CodyJung

I've determined that this is fixed if you replace string.ts:112:

	// Keep under the same block-quote but with line breaks
	return s.replace(markdownQuotedRegex, '\t\n>  ');

with:

	// Keep under the same block-quote but with line breaks
	return s.replace(markdownQuotedRegex, '  \n>  ');

In Markdown, a newline should be two spaces followed by a newline. But it looks like the tab+newline version of that code has been there for a couple years now, so I'm not sure what's changed. I can submit a PR if you'd like, but I don't fully understand why it's suddenly a problem.

CodyJung avatar Jun 26 '22 23:06 CodyJung