1
0
Fork 0

fix(shared): Guard remark-intro-plugin against missing data

This commit is contained in:
Joost De Cock 2022-05-31 10:13:43 +02:00
parent 2f7d6e4505
commit 3a903b7e17

View file

@ -30,7 +30,7 @@ export const remarkIntroPlugin = (opts={}) => {
const { intro=[] } = opts
// Check to see whether the node has frontmatter
const hasFrontmatter = node => (node.children[0].type === 'yaml')
const hasFrontmatter = node => (node?.children?.[0]?.type === 'yaml')
// Pulls text out of a paragraph
const extractIntro = node => {