mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-10 07:19:02 +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
|
tokensLength: token.tokens?.length || 0
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Since this is an atom node, we don't need child content
|
||||||
const result = {
|
const result = {
|
||||||
type: this.name,
|
type: 'yamlFrontMatter', // Use explicit node name instead of this.name
|
||||||
attrs: {
|
attrs: {
|
||||||
content: token.text || ''
|
content: token.text || ''
|
||||||
},
|
}
|
||||||
content: helpers.parseChildren(token.tokens || [])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info('✅ parseMarkdown() result', {
|
logger.info('✅ parseMarkdown() result', {
|
||||||
type: result.type,
|
type: result.type,
|
||||||
contentLength: result.attrs.content.length,
|
contentLength: result.attrs.content.length
|
||||||
hasContent: !!result.content
|
|
||||||
})
|
})
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user