如何在 C# .NET 文档中添加换行符
这应该更容易...
我想在我的代码中的 XML 文档中添加一个“编码”换行符
/// <summary>
/// Get a human-readable variant of the SQL WHERE statement of the search element. <br/>
/// Rather than return SQL, this method returns a string with icon-tokens, which
/// could be used to represent the search in a condensed pictogram format.
/// </summary>
如您所见,我找到了一些答案,演示了添加 <和>括号。 有趣的是,好'ol < br/>换行符不会在 Intellisense 弹出窗口中创建换行符。
我觉得这很烦人...
有什么建议吗?
This should be waaaay easier...
I want to add a "coded" line break to the XML documentation in my code
/// <summary>
/// Get a human-readable variant of the SQL WHERE statement of the search element. <br/>
/// Rather than return SQL, this method returns a string with icon-tokens, which
/// could be used to represent the search in a condensed pictogram format.
/// </summary>
As you can see, I found some answers that demonstrated adding < and > brackets.
Interestingly, the good 'ol < br/ > line break does not create a line break in the Intellisense popup.
I find this annoying...
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您可以使用
标记来生成段落分隔符,也可以将文本包裹在
标记中将文本分组并在其后添加空行,但没有与
或类似的内容等效的内容。 (根据 这个旧的 MS 论坛帖子是有意设计的。)您可以获得可用标签的列表在 MS 的这篇文档文章中。 记录您的代码示例(基于原始OP示例):
You can use a
<para />
tag to produce a paragraph break or you can wrap text in<para></para>
tags as a way to group the text and add the blank line after it, but there is no equivalent to<br />
or anything like that. (Which according to this old MS forum post is by design.) You can get the list of available tags in this documentation article from MS. Documenting your codeExample (based on original OP sample):
从 Visual Studio 2019 开始,使用
作为注释中的换行符。示例:
请注意,当我们使用
而不是
。As of Visual Studio 2019, use
<br/>
for newlines in comments.Example:
Notice that there is no extra line added when we use
<br/>
instead of<para>
.这是我的用法,就像
,它正在工作:)This is my usage, like
<br/>
, it's working :)添加一个
标记,其中包含特殊字符、255 个字符或 不可见字符。它将像这样工作:
Add a
<para>
tag with a special char in it, the 255 char, or invisible char.It will work like this:
和
似乎不起作用,有时它并不是真正关于制作< ;para>
句子之间的分隔程度与希望有一个空行来分隔关注点一样多。我在这里提到这一点是因为这个问题似乎是许多此类性质的封闭问题的根源。我发现唯一有效的方法是
例如
结果
<br></br>
and<br />
do not seem to work, and sometimes it isn't really about making the<para>
sentences separate as much as the desire to have a blank line for concern separation. I am mentioning this here because this question seems to be to parent to many closed questions of this nature.The only thing I found to work was
For example
Results in