syavorsky/comment-parser

Allow handling or parsing hooks to allow some at-sign text (e.g., decorators) being treated as a new tag

Closed this issue · 1 comments

An issue was reported in eslint-plugin-jsdoc that we weren't properly handling decorators, due to our use of comment-parser treating it as a different tag.

I.e., for this:

/**
* @example ```ts
@transient()
class Foo { }

*/

...@transient() is interpreted as a new tag, when it is meant to be just some sample code within the @example (within the fenced triple back-ticks).

We'd like to see handling or parsing hooks added which can cause this sample block to be seen as one tag.

While the current custom parsers are flexible in customizing behavior for names, descriptions, etc., there is no current way to avoid always assuming that a ^\s*@(\S+) is always a new tag.

I intend to submit a PR shortly as a proposed way to address.

Thanks!

Closed by #66