Skip to content

Commit 3abb41c

Browse files
authored
fix: avoid sending blog post text twice in data payload (#12379)
1 parent 89b7b7f commit 3abb41c

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

sites/svelte.dev/src/lib/server/docs/index.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,7 @@ export async function get_sections(markdown) {
122122
title: 'Root',
123123
slug: 'root',
124124
sections: [],
125-
breadcrumbs: [''],
126-
text: ''
125+
breadcrumbs: ['']
127126
});
128127
let currentNodes = [root];
129128

@@ -140,8 +139,7 @@ export async function get_sections(markdown) {
140139
title: text,
141140
slug,
142141
sections: [],
143-
breadcrumbs: [...currentNodes[level].breadcrumbs, text],
144-
text: ''
142+
breadcrumbs: [...currentNodes[level].breadcrumbs, text]
145143
};
146144

147145
// Add the new node to the tree
@@ -152,9 +150,6 @@ export async function get_sections(markdown) {
152150
// Prepare for potential children of the new node
153151
currentNodes = currentNodes.slice(0, level + 1);
154152
currentNodes.push(newNode);
155-
} else if (line.trim() !== '') {
156-
// Add non-heading line to the text of the current section
157-
currentNodes[currentNodes.length - 1].text += line + '\n';
158153
}
159154
}
160155

sites/svelte.dev/src/lib/server/docs/types.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export interface Section {
66
// Currently, we are only going with 2 level headings, so this will be undefined. In future, we may want to support 3 levels, in which case this will be a list of sections
77
sections?: Section[];
88
breadcrumbs: string[];
9-
text: string;
109
}
1110

1211
export type Category = {

0 commit comments

Comments
 (0)