Skip to content

Commit 710e3a8

Browse files
committed
add embed headings
1 parent 1a1534b commit 710e3a8

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

utils/processMarkdownChunks.ts

+10-2
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,18 @@ export async function processMarkdownFile(filePath: string) {
215215
visit(tree, (node: any) => {
216216
switch (node.type) {
217217
case 'heading':
218-
if (node.depth <= 2 && node.children?.[0]?.value) {
218+
if (node.depth <= 3 && node.children?.[0]?.value) {
219219
flushBuffer();
220220
currentSection = node.children[0].value;
221-
// Don't create separate chunks for headings, just track them
221+
chunks.push({
222+
type: 'heading',
223+
content: node.children[0].value,
224+
metadata: {
225+
section: currentSection,
226+
sequence: sequence++,
227+
depth: node.depth,
228+
},
229+
});
222230
}
223231
break;
224232

0 commit comments

Comments
 (0)