Skip to content

Commit ec1264d

Browse files
committed
only prepend section title when necessary
1 parent 7e83273 commit ec1264d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

dist/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7914,9 +7914,11 @@ function format_api(
79147914
const fm = extract_frontmatter(markdown);
79157915
content = fm.content;
79167916
title = fm.metadata.title;
7917+
section_title = title;
79177918
} catch (e) {
79187919
content = markdown;
79197920
title = name;
7921+
section_title = "";
79207922
}
79217923

79227924
const section_slug = make_slug(title);
@@ -7927,7 +7929,6 @@ function format_api(
79277929
sections = [];
79287930
section_stack = [sections];
79297931
block_open = false;
7930-
section_title = title;
79317932

79327933
const html = marked_1(content, { renderer });
79337934

src/format/format_api.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,11 @@ export function format_api(
125125
const fm = extract_frontmatter(markdown);
126126
content = fm.content;
127127
title = fm.metadata.title;
128+
section_title = title;
128129
} catch (e) {
129130
content = markdown;
130131
title = name;
132+
section_title = "";
131133
}
132134

133135
const section_slug = make_slug(title);
@@ -138,7 +140,6 @@ export function format_api(
138140
sections = [];
139141
section_stack = [sections];
140142
block_open = false;
141-
section_title = title;
142143

143144
const html = marked(content, { renderer });
144145

0 commit comments

Comments
 (0)