File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
import iterateJsdoc from '../iterateJsdoc' ;
2
2
3
- const maskExamples = ( str , excludeTags ) => {
4
- const regExamples = new RegExp ( `([ \\t]+\\*)[ \\t]@(?:${ excludeTags . join ( '|' ) } )(?=[ \\n])([\\w|\\W]*?\\n)(?=[ \\t]*\\*(?:[ \\t]*@|\\/))` , 'g' ) ;
3
+ const maskExcludedContent = ( str , excludeTags ) => {
4
+ const regContent = new RegExp ( `([ \\t]+\\*)[ \\t]@(?:${ excludeTags . join ( '|' ) } )(?=[ \\n])([\\w|\\W]*?\\n)(?=[ \\t]*\\*(?:[ \\t]*@|\\/))` , 'g' ) ;
5
5
6
- return str . replace ( regExamples , ( match , margin , code ) => {
6
+ return str . replace ( regContent , ( match , margin , code ) => {
7
7
return ( new Array ( code . match ( / \n / g) . length + 1 ) ) . join ( margin + '\n' ) ;
8
8
} ) ;
9
9
} ;
@@ -20,7 +20,7 @@ export default iterateJsdoc(({
20
20
} = options ;
21
21
22
22
const reg = new RegExp ( / ^ (?: \/ ? \* * | [ \t ] * ) \* [ \t ] { 2 } / gm) ;
23
- const text = excludeTags . length ? maskExamples ( sourceCode . getText ( jsdocNode ) , excludeTags ) : sourceCode . getText ( jsdocNode ) ;
23
+ const text = excludeTags . length ? maskExcludedContent ( sourceCode . getText ( jsdocNode ) , excludeTags ) : sourceCode . getText ( jsdocNode ) ;
24
24
25
25
if ( reg . test ( text ) ) {
26
26
const lineBreaks = text . slice ( 0 , reg . lastIndex ) . match ( / \n / g) || [ ] ;
You can’t perform that action at this time.
0 commit comments