mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-26 03:31:24 +08:00
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:
parent
54503c0e62
commit
ef7e8a7201
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user