Add YAML front matter as atom node without child content

- Use explicit 'yamlFrontMatter' node name instead of dynamic this.name reference
- Remove child content parsing since atom nodes don't require children
- Simplify logging by removing redundant hasContent check
This commit is contained in:
suyao 2025-10-29 06:35:41 +08:00
parent 54503c0e62
commit ef7e8a7201
No known key found for this signature in database

View File

@ -78,18 +78,17 @@ export const YamlFrontMatter = Node.create({
tokensLength: token.tokens?.length || 0
})
// Since this is an atom node, we don't need child content
const result = {
type: this.name,
type: 'yamlFrontMatter', // Use explicit node name instead of this.name
attrs: {
content: token.text || ''
},
content: helpers.parseChildren(token.tokens || [])
}
}
logger.info('✅ parseMarkdown() result', {
type: result.type,
contentLength: result.attrs.content.length,
hasContent: !!result.content
contentLength: result.attrs.content.length
})
return result