File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -29,10 +29,10 @@ export const extendArray = <T>(arr1: T[], arr2: T[]): T[] => {
29
29
30
30
export const wrapComment = ( comment : string , additionalTags : DocumentationTag [ ] = [ ] ) : string [ ] => {
31
31
if ( ! comment ) return [ ] ;
32
- comment = comment . replace ( / ^ \( o p t i o n a l \) (?: - ) ? / gi, '' ) . trim ( ) ;
32
+ comment = comment . replace ( / ^ \( o p t i o n a l \) (?: - ) ? / gi, '' ) ;
33
33
if ( ! comment ) return [ ] ;
34
34
const result = [ '/**' ] ;
35
- while ( comment . trim ( ) . length > 0 ) {
35
+ while ( comment . length > 0 ) {
36
36
let index = 0 ;
37
37
for ( let i = 0 ; i <= 80 ; i ++ ) {
38
38
if ( comment [ i ] === ' ' ) index = i ;
@@ -41,7 +41,7 @@ export const wrapComment = (comment: string, additionalTags: DocumentationTag[]
41
41
break ;
42
42
}
43
43
}
44
- if ( comment . length <= 80 ) {
44
+ if ( comment . length <= 80 && ! comment . includes ( '\n' ) ) {
45
45
index = 80 ;
46
46
}
47
47
result . push ( ` * ${ comment . substring ( 0 , index ) } ` ) ;
You can’t perform that action at this time.
0 commit comments