Skip to content

Commit

Permalink
fix: frontmatter parse issue with Colon in H1 (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
YoRolling authored Mar 31, 2024
1 parent d3de99d commit 2e467d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/vite/plugins/remark/inferred-frontmatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function remarkInferFrontmatter() {
const value = child.value
const [, title, description] = value.includes('[')
? value.match(/(.*) \[(.*)\]/) || []
: [undefined, value]
: [undefined, JSON.stringify(value)]

const frontmatterIndex = parent.children.findIndex((child) => child.type === 'yaml')
const index = frontmatterIndex > 0 ? frontmatterIndex : 0
Expand Down

0 comments on commit 2e467d7

Please sign in to comment.