哪个标记应该在Javadoc中用作段分隔符? [英] Which tag should be used as paragraph separator in Javadoc?
问题描述
哪个是更合适的HTML标签用于分解javadoc的段落/长段,以便根据最佳做法?
Which is the more appropriate HTML tag for breaking up paragraphs/long sections of javadoc so according to best practices?
是< p />
或< br / / code>?为什么?
Is it <p />
or <br />
? Why?
推荐答案
欢迎来到HTML 3.2。
Welcome to the land of HTML 3.2.
根据关于编写文档注释的官方指南,分隔段落的正确方法是使用段落标签:< P>
。请查看文档备注格式部分中的第七个项目符号 a>。
According to the official guide on writing doc comments, the correct way to separate paragraphs is with the paragraph tag: <P>
. Take a look at the seventh bullet in the section on Format of a Doc Comment.
通常,我强烈建议不要使用这些旧的,过时的标记做法。然而,在这种情况下,有一个体面的理由,使一个例外。 JavaDoc工具(除非使用自定义Doclet进行彻底更新)会生成旧的,粗糙的,有些破损的标记。浏览器被建立为向后兼容的一天的疯狂的老标记,所以它是有道理的,只是去与它。您使用< P>
分隔段落将与JavaDoc输出的其余部分一致。
Ordinarily, I would strongly recommend against using such old, outdated practices for markup. However, in this case, there's a decent reason to make an exception. The JavaDoc tool (unless radically updated with custom Doclets) generates old, crufty, somewhat broken markup. Browsers have been built to be backwards-compatible with the crazy old markup of the day, so it makes sense for you to just go along with it. Your use of <P>
to separate paragraphs will be in line with the rest of the JavaDoc output.
这篇关于哪个标记应该在Javadoc中用作段分隔符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!