如何让 BitBucket 识别提交注释中的换行符?

How do I make BitBucket recognize line breaks in commit comments?

我使用 mercurial,并使用长(大概)、多行提交注释。

最近,我将我的项目放在 BitBucket.org 上,并注意到当我的提交评论附加到问题页面时(有关 how/when 的信息,请参阅 this SO question ), 换行符替换为空格,而双换行符保持双换行符。

我应该如何在提交消息中标记单个换行符以便 BitBucket 确认它们?当我通常从命令行阅读评论时,我想以最不突兀的方式执行此操作。

用空行分隔段落(生成 <p> 标记)。通过以两个或更多空格结束第一行来换行(生成 <br> 标记),例如

Line one␣␣
Line two

Bitbucket 使用 Markdown, which has this to say about paragraphs and line breaks:

格式化评论

Paragraphs and Line Breaks

A paragraph is simply one or more consecutive lines of text, separated by one or more blank lines. (A blank line is any line that looks like a blank line — a line containing nothing but spaces or tabs is considered blank.) Normal paragraphs should not be indented with spaces or tabs.

The implication of the "one or more consecutive lines of text" rule is that Markdown supports "hard-wrapped" text paragraphs. This differs significantly from most other text-to-HTML formatters (including Movable Type’s "Convert Line Breaks" option) which translate every line break character in a paragraph into a <br /> tag.

When you do want to insert a <br /> break tag using Markdown, you end a line with two or more spaces, then type return.

Yes, this takes a tad more effort to create a <br />, but a simplistic "every line break is a <br />" rule wouldn’t work for Markdown. Markdown’s email-style blockquoting and multi-paragraph list items work best — and look better — when you format them with hard breaks.