Skip to content

Commit 838e395

Browse files
committed
feat(web): make headings more distinct
1 parent 1aef493 commit 838e395

File tree

1 file changed

+10
-20
lines changed

1 file changed

+10
-20
lines changed

src/generators/jsx-ast/utils/buildBarProps.mjs

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import readingTime from 'reading-time';
44
import { visit } from 'unist-util-visit';
55

6-
import { getFullName } from './signature.mjs';
76
import getConfig from '../../../utils/configuration/index.mjs';
87
import {
98
GITHUB_EDIT_URL,
@@ -49,25 +48,16 @@ const extractHeading = entry => {
4948

5049
const cliFlagOrEnv = [...data.text.matchAll(/`(-[\w-]+|[A-Z0-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,

0 commit comments

Comments
 (0)