catharsis icon indicating copy to clipboard operation
catharsis copied to clipboard

Type-expression parser should handle nested type unions without enclosing in parentheses.

Open jdalton opened this issue 8 years ago • 2 comments

Lodash is looking into using jsdoc and we're running into issues

The type-expression parser doesn't handle nested type unions unless all of the type unions are enclosed in parentheses. So for example this fails:

{Function|...(string|string[])}

but this is ok

{(Function|...(string|string[]))}

jdalton avatar Jan 30 '16 17:01 jdalton

I'm open to implementing this, but I think I tried once already and ended up flailing. You might be better off biting the bullet and enclosing your type unions in parentheses, as in the second example.

hegemonic avatar Feb 04 '16 02:02 hegemonic

Wouldn't be too difficult to do a global search & replace for future releases, but there still remains the concern of generating documentation for releases that have already been published. For this, there would need to be some sort of preprocessing layer in order to correctly generate the markdown for legacy releases.

justinhelmer avatar Feb 04 '16 03:02 justinhelmer