jsdoc/jsdoc.github.io

Can inline tags have line breaks?

notetiene opened this issue · 1 comments

I'm currently using the JSDoc format as my primary way to document JavaScript implementations. I've never really used the documentation generator because I don't see a need yet.

However I find the format awesome and it makes code much easier to read (by the way thanks).

Since I'm using GNU Emacs as my primary text-editor, it includes by default basic support for JSDoc block syntax comments. The default behavior let us fill a comment without breaking the block syntax. However, the comment contains an inline tag, it may be broken arbitrarily given things such as:

/**
 * @foo
 * Description. Link to other symbol {@link
 * document.body.style}
 * @bar
 */

We can see in this example a line break inside an inline comment.

I was now wondering: is it a valid inline tag? Even if it was so, could we recommend against doing that? It might make parsers harder to implement and also makes it harder to read.

I read the JSDoc specification and I don't see any mentioning its validity. Since it's inline means on one line, I assumed it was a bad practice and therefore made a patch to the default GNU Emacs tree to forbid breaking the line when inside an inline tag[1].

[1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=26550

I've updated the issue description. I accidentally submitted the original issue without a description.