0

我有一些 C# 文档注释,如下所示:

/// <para>
/// Pre-Conditions:
/// </para>
/// <para>
///     1. The sky must be clear.
/// </para>
/// <para>
///     2. It must be night time.
/// </para>
/// <para>
/// Post-Conditions:
/// </para>
/// <para>
///     1. A picture of the sky will be saved.
/// </para>
/// <para>
///     2. Some second thing will be true that I can't think of.
/// </para>
/// <para>
/// Invariants:
/// </para>
/// <para>
///     1. Existing pictures will not be changed.
/// </para>
void TakePictureOfStars();

我将所有内容都制作成了自己的段落,因此当我在 Visual Studio 中使用鼠标悬停工具提示时,它可以正确显示。

我使用 Doxygen 生成评论,但我不断收到以下 HTML:

<ol type="1">
    <li>The sky must be clear.</li>
</ol>
<ol type="1">
    <li>It must be night time.</li>
</ol>

看起来像这样:

1. The sky must be clear.

1. It must be night time.

所以,问题来了:如何让每个编号的项目在 Visual Studio 工具提示中显示在自己的行上,并在我的代码输出中获得有序列表?

4

1 回答 1

2

设置MARKDOWN_SUPPORTNO将避免 1. 2. 3. 标记被视为有序列表。

要保留空间,您可以使用<pre>and </pre>

/// <para><pre>
/// Pre-Conditions:
/// </pre></para>
/// <para><pre>
///     1. The sky must be clear.
/// </pre></para>
/// <para><pre>
///     2. It must be night time.
///        a. half moon
///        b. full moon
/// </pre></para>   
于 2013-02-03T09:01:25.667 回答