Skip to content

Commit

Permalink
Supports Chinese Docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
Aruelius authored Nov 1, 2023
1 parent e343ca7 commit a2d537a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ class DocStringConverter {

// catch-all for styles except reST
const hasArguments =
!line?.endsWith(':') && !line?.endsWith('::') && !!line.match(/^\s*.*?\w+(\s*\(.*?\))*\s*:\s*\w+/g);
!line?.endsWith(':') && !line?.endsWith('::') && !!line.match(/^\s*.*?\w+(\s*\(.*?\))*\s*:[\s\S]*/g);

Check failure

Code scanning / CodeQL

Inefficient regular expression High

This part of the regular expression may cause exponential backtracking on strings starting with '0(' and containing many repetitions of ')('.

// reSt params. Attempt to put directives lines into their own paragraphs.
const restDirective = DirectivesExtraNewlineRegExp.test(line); //line.match(/^\s*:param/);
Expand Down

0 comments on commit a2d537a

Please sign in to comment.