Skip to content

Commit 55d2ec7

Browse files
committed
organize
1 parent e496326 commit 55d2ec7

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export const createSourceLink = sourceLink =>
9292
* @param {import('mdast').Node} content - The content node to extract text from
9393
*/
9494
export const extractHeadingContent = content => {
95-
const { text } = content.data;
95+
const { text, type } = content.data;
9696

9797
if (!text) {
9898
return content.children;
@@ -102,7 +102,7 @@ export const extractHeadingContent = content => {
102102
const fullName = getFullName(content.data, false);
103103

104104
if (fullName) {
105-
return fullName;
105+
return type === 'ctor' ? `${fullName} Constructor` : fullName;
106106
}
107107

108108
// Find the index of the first colon, i.e. `Class:`.
@@ -126,10 +126,6 @@ export const createHeadingElement = (content, changeElement) => {
126126

127127
let headingContent = extractHeadingContent(content);
128128

129-
if (type === 'ctor') {
130-
headingContent += ' Constructor';
131-
}
132-
133129
// Build heading with anchor link
134130
const headingWrapper = createElement('div', [
135131
createElement(`h${depth}`, [

0 commit comments

Comments
 (0)