Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit c9c7cc7

Browse files
committed
Fix the regex parsing for valueless parameters
The @apiPrivate parameter does not take any value, and the @apiDeprecated parameter has an optional value. However, the regular expression in Parser.prototype.findElements expects that every parameter has a value. This may lead to the subsequent apiDoc parameter getting matched into the valueless parameter, removing it from the final generated apiDocs. Switching the regular expression from (.+?) to (.*?) allows the parameter's value to be optional.
1 parent 2069f4e commit c9c7cc7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ Parser.prototype.findElements = function(block, filename) {
448448
block = block.replace(/\n/g, '\uffff');
449449

450450
// Elements start with @
451-
var elementsRegExp = /(@(\w*)\s?(.+?)(?=\uffff[\s\*]*@|$))/gm;
451+
var elementsRegExp = /(@(\w*)\s?(.*?)(?=\uffff[\s\*]*@|$))/gm;
452452
var matches = elementsRegExp.exec(block);
453453
while (matches) {
454454
var element = {

0 commit comments

Comments
 (0)