File tree Expand file tree Collapse file tree 1 file changed +10
-20
lines changed
src/generators/jsx-ast/utils Expand file tree Collapse file tree 1 file changed +10
-20
lines changed Original file line number Diff line number Diff line change 33import readingTime from 'reading-time' ;
44import { visit } from 'unist-util-visit' ;
55
6- import { getFullName } from './signature.mjs' ;
76import getConfig from '../../../utils/configuration/index.mjs' ;
87import {
98 GITHUB_EDIT_URL ,
@@ -49,25 +48,16 @@ const extractHeading = entry => {
4948
5049 const cliFlagOrEnv = [ ...data . text . matchAll ( / ` ( - [ \w - ] + | [ A - Z 0 - 9 _ ] + = ) / g) ] ;
5150
52- let heading ;
53-
54- if ( cliFlagOrEnv . length > 0 ) {
55- heading = cliFlagOrEnv . at ( - 1 ) [ 1 ] ;
56- } else {
57- const rawName = data . name
58- // Remove any containing code blocks
59- . replace ( / ` / g, '' )
60- // Remove any prefixes (i.e. 'Class:')
61- . replace ( / ^ [ ^ : ] + : / , '' )
62- // Trim the remaining whitespace
63- . trim ( ) ;
64-
65- heading = getFullName ( data , rawName ) ;
66- }
67-
68- if ( data . type === 'ctor' ) {
69- heading += ' Constructor' ;
70- }
51+ const heading =
52+ cliFlagOrEnv . length > 0
53+ ? cliFlagOrEnv . at ( - 1 ) [ 1 ]
54+ : data . text
55+ // Remove any containing code blocks
56+ . replace ( / ` / g, '' )
57+ // Remove any prefixes (i.e. 'Class:')
58+ . replace ( / ^ [ ^ : ] + : / , '' )
59+ // Trim the remaining whitespace
60+ . trim ( ) ;
7161
7262 return {
7363 depth : entry . heading . depth ,
You can’t perform that action at this time.
0 commit comments