-
-
Notifications
You must be signed in to change notification settings - Fork 291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getDoclets() util ignores content when on a new line #25
Comments
If it is of any interest, there are some jsdoc parsers out in the wild that may save duplication of effort. Eslint built doctrine for the {
"description": "",
"tags": [
{
"title": "example",
"description": "Some instructions."
},
{
"title": "example",
"description": "Some other instructions."
}
]
} There are others as well, though in my estimation doctrine is the best and most maintained. Cheers! |
Where/when are you using I think I don't see why react-docgen should depend on an external tool if it doesn't use it itself though... |
Ah I see, fair enough :) |
Use Case
When writing
@example
s, it is common to have content on the line following the tag (as in the docs).Issue
getDoclets() does not correctly capture doclet contents if they are on a new line following the tag.
Expected:
{"example": "Some instructions."}
Actual:
{"example": true}
Edge Case
If text content is placed on the same line as the
@example
tag, then the entire example content is captured:Output
{"example": "foo\nSome instructions."}
Multiple Examples
It is very common to have multiple examples in one docblock. Since keys must be unique, the current util only permits a single example in the parsed docblock object.
Suggestion
The
example
key may be better suited as an array in the parsed object:Output
Let me know if I should file a separate issue for this.
EDIT
Originally submitted before completion.
The text was updated successfully, but these errors were encountered: