Community
Participate
Working Groups
build: 1.2.0.v201006041342-7C78FGDF9JgLWLMLM4Vsye Steps: 1. create test script file like /** * @returns a <code>new</code> Test */ function Test() { } 2. save it - notice the warning created on the first < of <code> about an unexpected tag Expected That this should work without warning. I tested this with a few other tags like <b>, <h4>, etc. It is not stated anywhere that using tags like this is not allowed in JSDoc...
even more cryptic, if you modify the snippet to: /** * @returns <code>a</code> new Test */ function Test() { } you get an additional fun warning: JSdoc: Malformed link reference line 3 along with the other warning: JSdoc: Unexpected tag line 3
making sure the tags appear anywhere after the second word makes the warnings go away???? /** * @return a new <code>Test</code> */ function Test() { } makes all warnings go away (notice the update to not use @returns as well)
Which JSDoc do you mean? I know of at least two slightly incompatible implementations out there. The first blob after the @returns is expected to be the type name itself, optionally inside of curly braces.
You get the unexpected tag warning in your first example because there is no return statement in the function. That is working as designed.
(In reply to comment #3) > Which JSDoc do you mean? I know of at least two slightly incompatible > implementations out there. I was not aware there was more than one, I looked at http://jsdoc.sourceforge.net/ > The first blob after the @returns is expected to be > the type name itself, optionally inside of curly braces. That makes sense, maybe the warning text could better explain this?
There are plans to clean up the errors/warnings messages in 3.3. We can address this then.