使用.NET代码文档XML时,将HTML标记在代码示例中包括在代码示例中
.NET具有用于记录代码的特定XML语法。
< c></c>
and < code>>>/code
标签允许在注释中添加代码spets,但要保证,他们没有'''当这些代码片段由HTML制成时,t可以很好地工作,这是一个问题,因为我想记录我功能的HTML标记输出。
例如,如果我编写以下(vb)文档注释:
''' <summary>
''' <code>
''' <div class="foo">Hello world</div>
''' </code>
''' </summary>
当我用指针悬停函数的名称时,它确实显示了“ Hello World”字符串,但没有显示HTML标记。它似乎正在解释它。
是否有一种方法可以像这些注释中一样显示HTML标记?
只是要清楚,我不是要为文档添加样式,我真的希望它显示HTML标记本身。
.NET has a specific XML syntax for documenting the code.
The <c></c>
and <code></code>
tags allow to add code snippets into the comments, but apprently, they don't work well when those code snippets are made of HTML, which is a problem, because I would like to document the HTML markup output of my function.
For example, if I write the following (VB) documentation comment :
''' <summary>
''' <code>
''' <div class="foo">Hello world</div>
''' </code>
''' </summary>
It does display the "Hello world" string when I hover the function's name with my pointer, but does not show the HTML markup as is. It seems to be interpreting it instead.
Is there a way to display HTML markup as is within those comments ?
Just to be clear, I'm not trying to add styling to the documentation, I really want it to display the HTML markup itself.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用CDATA:
例如,我的产品 vsdocman 具有评论编辑器,将CDATA放在<代码>&lt; code&gt; 自动阻止。
Use CDATA:
For example, my product VSdocman has the comment editor which puts CDATA in
<code>
blocks automatically.