Skip to content

Commit 0e28473

Browse files
committed
@apiParam should not leak Unicode linebreaks
Fixes apidoc#39
1 parent a12de92 commit 0e28473

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/parsers/api_param.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ function parse(content, source, defaultGroup) {
7979
if ( ! matches)
8080
return null;
8181

82+
// reverse Unicode Linebreaks
83+
matches.forEach(function (val, index, array) {
84+
if (val) {
85+
array[index] = val.replace(/\uffff/g, '\n');
86+
}
87+
});
88+
8289
var allowedValues = matches[4];
8390
if (allowedValues) {
8491
var regExp;
@@ -98,10 +105,6 @@ function parse(content, source, defaultGroup) {
98105
allowedValues = list;
99106
}
100107

101-
// Replace Unicode Linebreaks in description
102-
if (matches[10])
103-
matches[10] = matches[10].replace(/\uffff/g, '\n');
104-
105108
// Set global group variable
106109
group = matches[1] || defaultGroup || 'Parameter';
107110

0 commit comments

Comments
 (0)