Skip to content

Commit 71a8205

Browse files
committed
feat: strip YAML frontmatter from toMarkdown output
1 parent f153696 commit 71a8205

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ export default {
184184

185185
let markdown = result.data ?? '';
186186

187+
// Strip YAML frontmatter if present (generated by Workers AI toMarkdown)
188+
markdown = markdown.replace(/^---\n[\s\S]*?\n---\n*/, '');
189+
187190
// Proxy WeChat images through R2 (if configured)
188191
const rawHtmlForImages = isHtmlContent(contentType) ? new TextDecoder().decode(body) : '';
189192

0 commit comments

Comments
 (0)